content
stringlengths 1
1.04M
| input_ids
sequencelengths 1
774k
| ratio_char_token
float64 0.38
22.9
| token_count
int64 1
774k
|
---|---|---|---|
import numpy as np
from ukfm import SO3, SE3
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
class PENDULUM:
"""Pendulum example, where the state lives on the 2-sphere.
See a text description of the spherical pendulum dynamics in
:cite:`sjobergAn2019`, Section 7, and :cite:`kotaruVariation2019`.
:arg T: sequence time (s).
:arg model_freq: model frequency (Hz).
"""
g = 9.81
"gravity constant (m/s^2) :math:`g`."
m = 1.0
"mass of payload (kg) :math:`m`."
b = 0.0
"damping :math:`b`."
L = 1.3
"wire length :math:`L`."
e3 = -np.array([0, 0, 1])
"third coordinate vector :math:`\mathbf{e}^b=-[0,0,1]^T`."
H = np.zeros((2, 3))
"observability matrix :math:`\mathbf{H}`."
H[:, 1:3] = np.eye(2)
class STATE:
"""State of the system.
It represents the orientation of the wire and its angular velocity.
.. math::
\\boldsymbol{\\chi} \in \\mathcal{M} = \\left\\{ \\begin{matrix}
\\mathbf{C} \in SO(3),
\\mathbf{u} \in \\mathbb R^3
\\end{matrix} \\right\\}
:ivar Rot: rotation matrix :math:`\mathbf{C}`.
:ivar u: angular velocity vector :math:`\mathbf{u}`.
"""
class INPUT:
"""Input of the propagation model.
The model does not require any input.
"""
@classmethod
def f(cls, state, omega, w, dt):
""" Propagation function.
.. math::
\\mathbf{C}_{n+1} &= \\mathbf{C}_{n} \\exp\\left(\\left(\\mathbf{u}
+ \\mathbf{w}^{(0:3)} \\right) dt\\right), \\\\
\\mathbf{u}_{n+1} &= \\mathbf{u}_{n} + \\dot{\\mathbf{u}} dt,
where
.. math::
\\dot{\\mathbf{u}} = \\begin{bmatrix}
-\\omega_y \\omega_x\\ \\\\ \\omega_x \\omega_z
\\\\ 0 \end{bmatrix} +
\\frac{g}{l} \\left(\\mathbf{e}^b \\right)^\\wedge
\\mathbf{C}^T \\mathbf{e}^b + \\mathbf{w}^{(3:6)}
:var state: state :math:`\\boldsymbol{\\chi}`.
:var omega: input :math:`\\boldsymbol{\\omega}`.
:var w: noise :math:`\\mathbf{w}`.
:var dt: integration step :math:`dt` (s).
"""
e3_i = state.Rot.T.dot(cls.e3)
u = state.u
d_u = np.array([-u[1]*u[2], u[0]*u[2], 0]) + \
cls.g/cls.L*np.cross(cls.e3, e3_i)
new_state = cls.STATE(
Rot=state.Rot.dot(SO3.exp((u+w[:3])*dt)),
u=state.u + (d_u+w[3:6])*dt
)
return new_state
@classmethod
def h(cls, state):
""" Observation function.
.. math::
h\\left(\\boldsymbol{\\chi}\\right) =
\\mathbf{H} \mathbf{x},
where
.. math::
\mathbf{H}&= \\begin{bmatrix} 0 & 1 & 0 \\\\ 0
& 0 & 1 \end{bmatrix} \\\\
\mathbf{x} &= L \\mathbf{C} \mathbf{e}^b
with :math:`\mathbf{x}` the position of the pendulum.
:var state: state :math:`\\boldsymbol{\\chi}`.
"""
x = cls.L*state.Rot.dot(cls.e3)
return cls.H.dot(x)
@classmethod
def phi(cls, state, xi):
"""Retraction.
.. math::
\\varphi\\left(\\boldsymbol{\\chi}, \\boldsymbol{\\xi}\\right) =
\\left( \\begin{matrix}
\\exp\\left(\\boldsymbol{\\xi}^{(0:3)}\\right) \\mathbf{C} \\\\
\\mathbf{u} + \\boldsymbol{\\xi}^{(3:6)}
\\end{matrix} \\right)
The state is viewed as a element :math:`\\boldsymbol{\chi} \\in SO(3)
\\times \\mathbb R^3`.
Its corresponding inverse operation is :meth:`~ukfm.PENDULUM.phi_inv`.
:var state: state :math:`\\boldsymbol{\\chi}`.
:var xi: state uncertainty :math:`\\boldsymbol{\\xi}`.
"""
new_state = cls.STATE(
Rot=state.Rot.dot(SO3.exp(xi[:3])),
u=state.u + xi[3:6],
)
return new_state
@classmethod
def phi_inv(cls, state, hat_state):
"""Inverse retraction.
.. math::
\\varphi^{-1}_{\\boldsymbol{\\hat{\\chi}}}\\left(\\boldsymbol{\\chi}
\\right) = \\left( \\begin{matrix}
\\log\\left(\\mathbf{\\hat{C}}^T \\mathbf{C} \\right)\\\\
\\mathbf{u} - \\mathbf{\\hat{u}}
\\end{matrix} \\right)
The state is viewed as a element :math:`\\boldsymbol{\chi} \\in SO(3)
\\times \\mathbb R^3`.
Its corresponding retraction is :meth:`~ukfm.PENDULUM.phi`.
:var state: state :math:`\\boldsymbol{\\chi}`.
:var hat_state: noise-free state :math:`\\boldsymbol{\hat{\\chi}}`.
"""
xi = np.hstack([SO3.log(hat_state.Rot.T.dot(state.Rot)),
state.u - hat_state.u])
return xi
@classmethod
@classmethod
| [
11748,
299,
32152,
355,
45941,
198,
6738,
334,
74,
38353,
1330,
12809,
18,
11,
7946,
18,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
285,
489,
62,
25981,
74,
896,
13,
76,
29487,
18,
67,
1330,
12176,
274,
18,
35,
628,
198,
4871,
350,
10619,
6239,
5883,
25,
198,
220,
220,
220,
37227,
47,
437,
14452,
1672,
11,
810,
262,
1181,
3160,
319,
262,
362,
12,
2777,
1456,
13,
198,
220,
220,
220,
4091,
257,
2420,
6764,
286,
262,
43180,
44017,
14452,
17262,
287,
198,
220,
220,
220,
1058,
66,
578,
25,
63,
82,
73,
2023,
70,
2025,
23344,
47671,
7275,
767,
11,
290,
220,
1058,
66,
578,
25,
63,
74,
313,
11493,
23907,
341,
23344,
44646,
628,
220,
220,
220,
1058,
853,
309,
25,
8379,
640,
357,
82,
737,
198,
220,
220,
220,
1058,
853,
2746,
62,
19503,
80,
25,
2746,
8373,
357,
7399,
737,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
308,
796,
860,
13,
6659,
198,
220,
220,
220,
366,
46453,
6937,
357,
76,
14,
82,
61,
17,
8,
1058,
11018,
25,
63,
70,
63,
526,
628,
220,
220,
220,
285,
796,
352,
13,
15,
198,
220,
220,
220,
366,
22208,
286,
21437,
357,
10025,
8,
1058,
11018,
25,
63,
76,
63,
526,
628,
220,
220,
220,
275,
796,
657,
13,
15,
198,
220,
220,
220,
366,
67,
37843,
1058,
11018,
25,
63,
65,
63,
526,
628,
220,
220,
220,
406,
796,
352,
13,
18,
198,
220,
220,
220,
366,
21809,
4129,
1058,
11018,
25,
63,
43,
63,
526,
628,
220,
220,
220,
304,
18,
796,
532,
37659,
13,
18747,
26933,
15,
11,
657,
11,
352,
12962,
198,
220,
220,
220,
366,
17089,
20435,
15879,
1058,
11018,
25,
63,
59,
11018,
19881,
90,
68,
92,
61,
65,
10779,
58,
15,
11,
15,
11,
16,
60,
61,
51,
63,
526,
628,
220,
220,
220,
367,
796,
45941,
13,
9107,
418,
19510,
17,
11,
513,
4008,
198,
220,
220,
220,
366,
672,
3168,
1799,
17593,
1058,
11018,
25,
63,
59,
11018,
19881,
90,
39,
92,
63,
526,
198,
220,
220,
220,
367,
58,
45299,
352,
25,
18,
60,
796,
45941,
13,
25379,
7,
17,
8,
628,
220,
220,
220,
1398,
35454,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9012,
286,
262,
1080,
13,
628,
220,
220,
220,
220,
220,
220,
220,
632,
6870,
262,
12852,
286,
262,
6503,
290,
663,
32558,
15432,
13,
628,
220,
220,
220,
220,
220,
220,
220,
11485,
10688,
3712,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
36575,
1837,
23650,
90,
6852,
11072,
92,
3467,
259,
26867,
11018,
9948,
90,
44,
92,
796,
26867,
9464,
6852,
90,
26867,
27471,
90,
6759,
8609,
92,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
11018,
19881,
90,
34,
92,
3467,
259,
12809,
7,
18,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
11018,
19881,
90,
84,
92,
3467,
259,
26867,
11018,
11848,
371,
61,
18,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
437,
90,
6759,
8609,
92,
26867,
3506,
6852,
92,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
452,
283,
18481,
25,
13179,
17593,
1058,
11018,
25,
63,
59,
11018,
19881,
90,
34,
92,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
452,
283,
334,
25,
32558,
15432,
15879,
1058,
11018,
25,
63,
59,
11018,
19881,
90,
84,
92,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
1398,
3268,
30076,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
20560,
286,
262,
43594,
2746,
13,
628,
220,
220,
220,
220,
220,
220,
220,
383,
2746,
857,
407,
2421,
597,
5128,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
277,
7,
565,
82,
11,
1181,
11,
37615,
11,
266,
11,
288,
83,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
8772,
363,
341,
2163,
13,
628,
220,
220,
220,
220,
220,
220,
220,
11485,
10688,
3712,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
11018,
19881,
90,
34,
92,
23330,
77,
10,
16,
92,
220,
1222,
28,
26867,
11018,
19881,
90,
34,
92,
23330,
77,
92,
26867,
11201,
6852,
9464,
7,
6852,
9464,
7,
6852,
11018,
19881,
90,
84,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1343,
26867,
11018,
19881,
90,
86,
92,
36796,
7,
15,
25,
18,
38165,
26867,
3506,
8,
288,
83,
6852,
3506,
828,
220,
3467,
6852,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
11018,
19881,
90,
84,
92,
23330,
77,
10,
16,
92,
220,
1222,
28,
26867,
11018,
19881,
90,
84,
92,
23330,
77,
92,
1343,
26867,
26518,
90,
6852,
11018,
19881,
90,
84,
11709,
220,
288,
83,
11,
628,
220,
220,
220,
220,
220,
220,
220,
810,
628,
220,
220,
220,
220,
220,
220,
220,
11485,
10688,
3712,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
26518,
90,
6852,
11018,
19881,
90,
84,
11709,
220,
796,
26867,
27471,
90,
65,
6759,
8609,
92,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
6852,
462,
4908,
62,
88,
220,
26867,
462,
4908,
62,
87,
6852,
3467,
6852,
59,
26867,
462,
4908,
62,
87,
26867,
462,
4908,
62,
89,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3467,
6852,
59,
657,
3467,
437,
90,
65,
6759,
8609,
92,
1343,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
31944,
90,
70,
18477,
75,
92,
220,
26867,
9464,
7,
6852,
11018,
19881,
90,
68,
92,
61,
65,
26867,
3506,
8,
61,
6852,
86,
14907,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
11018,
19881,
90,
34,
92,
61,
51,
26867,
11018,
19881,
90,
68,
92,
61,
65,
1343,
26867,
11018,
19881,
90,
86,
92,
36796,
7,
18,
25,
21,
38165,
220,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7785,
1181,
25,
1181,
1058,
11018,
25,
63,
6852,
36575,
1837,
23650,
90,
6852,
11072,
92,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7785,
37615,
25,
5128,
1058,
11018,
25,
63,
6852,
36575,
1837,
23650,
90,
6852,
462,
4908,
92,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7785,
266,
25,
7838,
1058,
11018,
25,
63,
6852,
11018,
19881,
90,
86,
92,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7785,
288,
83,
25,
11812,
2239,
1058,
11018,
25,
63,
28664,
63,
357,
82,
737,
628,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
304,
18,
62,
72,
796,
1181,
13,
24864,
13,
51,
13,
26518,
7,
565,
82,
13,
68,
18,
8,
198,
220,
220,
220,
220,
220,
220,
220,
334,
796,
1181,
13,
84,
198,
220,
220,
220,
220,
220,
220,
220,
288,
62,
84,
796,
45941,
13,
18747,
26933,
12,
84,
58,
16,
60,
9,
84,
58,
17,
4357,
334,
58,
15,
60,
9,
84,
58,
17,
4357,
657,
12962,
1343,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
537,
82,
13,
70,
14,
565,
82,
13,
43,
9,
37659,
13,
19692,
7,
565,
82,
13,
68,
18,
11,
304,
18,
62,
72,
8,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
5219,
796,
537,
82,
13,
44724,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18481,
28,
5219,
13,
24864,
13,
26518,
7,
15821,
18,
13,
11201,
19510,
84,
10,
86,
58,
25,
18,
12962,
9,
28664,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
28,
5219,
13,
84,
1343,
357,
67,
62,
84,
10,
86,
58,
18,
25,
21,
12962,
9,
28664,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
62,
5219,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
289,
7,
565,
82,
11,
1181,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
11086,
13208,
2163,
13,
628,
220,
220,
220,
220,
220,
220,
220,
11485,
10688,
3712,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
289,
6852,
9464,
7,
6852,
36575,
1837,
23650,
90,
6852,
11072,
92,
6852,
3506,
8,
220,
796,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
11018,
19881,
90,
39,
92,
3467,
11018,
19881,
90,
87,
5512,
628,
220,
220,
220,
220,
220,
220,
220,
810,
220,
628,
220,
220,
220,
220,
220,
220,
220,
11485,
10688,
3712,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3467,
11018,
19881,
90,
39,
92,
5,
28,
26867,
27471,
90,
65,
6759,
8609,
92,
657,
1222,
352,
1222,
657,
3467,
6852,
59,
220,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1222,
657,
1222,
352,
3467,
437,
90,
65,
6759,
8609,
92,
3467,
6852,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3467,
11018,
19881,
90,
87,
92,
1222,
28,
406,
26867,
11018,
19881,
90,
34,
92,
3467,
11018,
19881,
90,
68,
92,
61,
65,
628,
220,
220,
220,
220,
220,
220,
220,
351,
1058,
11018,
25,
63,
59,
11018,
19881,
90,
87,
92,
63,
262,
2292,
286,
262,
44017,
14452,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7785,
1181,
25,
1181,
1058,
11018,
25,
63,
6852,
36575,
1837,
23650,
90,
6852,
11072,
92,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
796,
537,
82,
13,
43,
9,
5219,
13,
24864,
13,
26518,
7,
565,
82,
13,
68,
18,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
537,
82,
13,
39,
13,
26518,
7,
87,
8,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
872,
72,
7,
565,
82,
11,
1181,
11,
2124,
72,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
9781,
7861,
13,
628,
220,
220,
220,
220,
220,
220,
220,
11485,
10688,
3712,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
7785,
34846,
6852,
9464,
7,
6852,
36575,
1837,
23650,
90,
6852,
11072,
5512,
26867,
36575,
1837,
23650,
90,
6852,
29992,
92,
6852,
3506,
8,
796,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
9464,
7,
26867,
27471,
90,
6759,
8609,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
11201,
6852,
9464,
7,
6852,
36575,
1837,
23650,
90,
6852,
29992,
92,
36796,
7,
15,
25,
18,
38165,
6852,
3506,
8,
26867,
11018,
19881,
90,
34,
92,
220,
3467,
6852,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
11018,
19881,
90,
84,
92,
1343,
26867,
36575,
1837,
23650,
90,
6852,
29992,
92,
36796,
7,
18,
25,
21,
38165,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
437,
90,
6759,
8609,
92,
26867,
3506,
8,
628,
220,
220,
220,
220,
220,
220,
220,
383,
1181,
318,
9569,
355,
257,
5002,
1058,
11018,
25,
63,
6852,
36575,
1837,
23650,
31478,
11072,
92,
26867,
259,
12809,
7,
18,
8,
220,
198,
220,
220,
220,
220,
220,
220,
220,
26867,
22355,
26867,
11018,
11848,
371,
61,
18,
44646,
628,
220,
220,
220,
220,
220,
220,
220,
6363,
11188,
34062,
4905,
318,
1058,
76,
2788,
25,
63,
93,
2724,
38353,
13,
47,
10619,
6239,
5883,
13,
34846,
62,
16340,
44646,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7785,
1181,
25,
1181,
1058,
11018,
25,
63,
6852,
36575,
1837,
23650,
90,
6852,
11072,
92,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7785,
2124,
72,
25,
1181,
13479,
1058,
11018,
25,
63,
6852,
36575,
1837,
23650,
90,
6852,
29992,
92,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
5219,
796,
537,
82,
13,
44724,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18481,
28,
5219,
13,
24864,
13,
26518,
7,
15821,
18,
13,
11201,
7,
29992,
58,
25,
18,
12962,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
28,
5219,
13,
84,
1343,
2124,
72,
58,
18,
25,
21,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
649,
62,
5219,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
872,
72,
62,
16340,
7,
565,
82,
11,
1181,
11,
6877,
62,
5219,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
818,
4399,
1005,
7861,
13,
628,
220,
220,
220,
220,
220,
220,
220,
11485,
10688,
3712,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
7785,
34846,
36796,
12,
16,
92,
23330,
6852,
36575,
1837,
23650,
90,
6852,
5183,
90,
6852,
11072,
42535,
6852,
9464,
7,
6852,
36575,
1837,
23650,
90,
6852,
11072,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
3506,
8,
796,
26867,
9464,
7,
26867,
27471,
90,
6759,
8609,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
6404,
6852,
9464,
7,
6852,
11018,
19881,
90,
6852,
5183,
90,
34,
11709,
61,
51,
26867,
11018,
19881,
90,
34,
92,
220,
26867,
3506,
8,
13426,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
11018,
19881,
90,
84,
92,
532,
26867,
11018,
19881,
90,
6852,
5183,
90,
84,
11709,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26867,
437,
90,
6759,
8609,
92,
26867,
3506,
8,
628,
220,
220,
220,
220,
220,
220,
220,
383,
1181,
318,
9569,
355,
257,
5002,
1058,
11018,
25,
63,
6852,
36575,
1837,
23650,
31478,
11072,
92,
26867,
259,
12809,
7,
18,
8,
220,
198,
220,
220,
220,
220,
220,
220,
220,
26867,
22355,
26867,
11018,
11848,
371,
61,
18,
44646,
628,
220,
220,
220,
220,
220,
220,
220,
6363,
11188,
1005,
7861,
318,
1058,
76,
2788,
25,
63,
93,
2724,
38353,
13,
47,
10619,
6239,
5883,
13,
34846,
44646,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
7785,
1181,
25,
1181,
1058,
11018,
25,
63,
6852,
36575,
1837,
23650,
90,
6852,
11072,
92,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7785,
6877,
62,
5219,
25,
7838,
12,
5787,
1181,
1058,
11018,
25,
63,
6852,
36575,
1837,
23650,
31478,
5183,
90,
6852,
11072,
11709,
44646,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
72,
796,
45941,
13,
71,
25558,
26933,
15821,
18,
13,
6404,
7,
5183,
62,
5219,
13,
24864,
13,
51,
13,
26518,
7,
5219,
13,
24864,
36911,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1181,
13,
84,
532,
6877,
62,
5219,
13,
84,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2124,
72,
628,
220,
220,
220,
2488,
4871,
24396,
628,
220,
220,
220,
2488,
4871,
24396,
198
] | 1.900667 | 2,547 |
"""Run the Sample ACE problem from [Breiman85]_."""
import numpy.random
import scipy.special
from ace import ace
def build_sample_ace_problem_breiman85(N=200):
"""Sample problem from Breiman 1985."""
x_cubed = numpy.random.standard_normal(N)
x = scipy.special.cbrt(x_cubed)
noise = numpy.random.standard_normal(N)
y = numpy.exp((x ** 3.0) + noise)
return [x], y
def build_sample_ace_problem_breiman2(N=500):
"""Build sample problem y(x) = exp(sin(x))."""
x = numpy.linspace(0, 1, N)
# x = numpy.random.uniform(0, 1, size=N)
noise = numpy.random.standard_normal(N)
y = numpy.exp(numpy.sin(2 * numpy.pi * x)) + 0.0 * noise
return [x], y
def run_breiman85():
"""Run Breiman 85 sample."""
x, y = build_sample_ace_problem_breiman85(200)
ace_solver = ace.ACESolver()
ace_solver.specify_data_set(x, y)
ace_solver.solve()
try:
ace.plot_transforms(ace_solver, 'sample_ace_breiman85.png')
except ImportError:
pass
return ace_solver
def run_breiman2():
"""Run Breiman's other sample problem."""
x, y = build_sample_ace_problem_breiman2(500)
ace_solver = ace.ACESolver()
ace_solver.specify_data_set(x, y)
ace_solver.solve()
try:
plt = ace.plot_transforms(ace_solver, None)
except ImportError:
pass
plt.subplot(1, 2, 1)
phi = numpy.sin(2.0 * numpy.pi * x[0])
plt.plot(x[0], phi, label='analytic')
plt.legend()
plt.subplot(1, 2, 2)
y = numpy.exp(phi)
plt.plot(y, phi, label='analytic')
plt.legend(loc='lower right')
# plt.show()
plt.savefig('no_noise_linear_x.png')
return ace_solver
if __name__ == '__main__':
run_breiman2()
| [
37811,
10987,
262,
27565,
40488,
1917,
422,
685,
12679,
24086,
5332,
60,
62,
526,
15931,
198,
198,
11748,
299,
32152,
13,
25120,
198,
11748,
629,
541,
88,
13,
20887,
198,
198,
6738,
31506,
1330,
31506,
628,
198,
4299,
1382,
62,
39873,
62,
558,
62,
45573,
62,
4679,
24086,
5332,
7,
45,
28,
2167,
2599,
198,
220,
220,
220,
37227,
36674,
1917,
422,
3719,
24086,
12863,
526,
15931,
198,
220,
220,
220,
2124,
62,
66,
549,
276,
796,
299,
32152,
13,
25120,
13,
20307,
62,
11265,
7,
45,
8,
198,
220,
220,
220,
2124,
796,
629,
541,
88,
13,
20887,
13,
66,
1671,
83,
7,
87,
62,
66,
549,
276,
8,
198,
220,
220,
220,
7838,
796,
299,
32152,
13,
25120,
13,
20307,
62,
11265,
7,
45,
8,
198,
220,
220,
220,
331,
796,
299,
32152,
13,
11201,
19510,
87,
12429,
513,
13,
15,
8,
1343,
7838,
8,
198,
220,
220,
220,
1441,
685,
87,
4357,
331,
628,
198,
4299,
1382,
62,
39873,
62,
558,
62,
45573,
62,
4679,
24086,
17,
7,
45,
28,
4059,
2599,
198,
220,
220,
220,
37227,
15580,
6291,
1917,
331,
7,
87,
8,
796,
1033,
7,
31369,
7,
87,
4008,
526,
15931,
198,
220,
220,
220,
2124,
796,
299,
32152,
13,
21602,
10223,
7,
15,
11,
352,
11,
399,
8,
198,
220,
220,
220,
1303,
2124,
796,
299,
32152,
13,
25120,
13,
403,
6933,
7,
15,
11,
352,
11,
2546,
28,
45,
8,
198,
220,
220,
220,
7838,
796,
299,
32152,
13,
25120,
13,
20307,
62,
11265,
7,
45,
8,
198,
220,
220,
220,
331,
796,
299,
32152,
13,
11201,
7,
77,
32152,
13,
31369,
7,
17,
1635,
299,
32152,
13,
14415,
1635,
2124,
4008,
1343,
657,
13,
15,
1635,
7838,
198,
220,
220,
220,
1441,
685,
87,
4357,
331,
628,
198,
4299,
1057,
62,
4679,
24086,
5332,
33529,
198,
220,
220,
220,
37227,
10987,
3719,
24086,
7600,
6291,
526,
15931,
198,
220,
220,
220,
2124,
11,
331,
796,
1382,
62,
39873,
62,
558,
62,
45573,
62,
4679,
24086,
5332,
7,
2167,
8,
198,
220,
220,
220,
31506,
62,
82,
14375,
796,
31506,
13,
2246,
1546,
14375,
3419,
198,
220,
220,
220,
31506,
62,
82,
14375,
13,
16684,
1958,
62,
7890,
62,
2617,
7,
87,
11,
331,
8,
198,
220,
220,
220,
31506,
62,
82,
14375,
13,
82,
6442,
3419,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
31506,
13,
29487,
62,
7645,
23914,
7,
558,
62,
82,
14375,
11,
705,
39873,
62,
558,
62,
4679,
24086,
5332,
13,
11134,
11537,
198,
220,
220,
220,
2845,
17267,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
1441,
31506,
62,
82,
14375,
198,
198,
4299,
1057,
62,
4679,
24086,
17,
33529,
198,
220,
220,
220,
37227,
10987,
3719,
24086,
338,
584,
6291,
1917,
526,
15931,
198,
220,
220,
220,
2124,
11,
331,
796,
1382,
62,
39873,
62,
558,
62,
45573,
62,
4679,
24086,
17,
7,
4059,
8,
198,
220,
220,
220,
31506,
62,
82,
14375,
796,
31506,
13,
2246,
1546,
14375,
3419,
198,
220,
220,
220,
31506,
62,
82,
14375,
13,
16684,
1958,
62,
7890,
62,
2617,
7,
87,
11,
331,
8,
198,
220,
220,
220,
31506,
62,
82,
14375,
13,
82,
6442,
3419,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
458,
83,
796,
31506,
13,
29487,
62,
7645,
23914,
7,
558,
62,
82,
14375,
11,
6045,
8,
198,
220,
220,
220,
2845,
17267,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
458,
83,
13,
7266,
29487,
7,
16,
11,
362,
11,
352,
8,
198,
220,
220,
220,
872,
72,
796,
299,
32152,
13,
31369,
7,
17,
13,
15,
1635,
299,
32152,
13,
14415,
1635,
2124,
58,
15,
12962,
198,
220,
220,
220,
458,
83,
13,
29487,
7,
87,
58,
15,
4357,
872,
72,
11,
6167,
11639,
38200,
13370,
11537,
198,
220,
220,
220,
458,
83,
13,
1455,
437,
3419,
198,
220,
220,
220,
458,
83,
13,
7266,
29487,
7,
16,
11,
362,
11,
362,
8,
198,
220,
220,
220,
331,
796,
299,
32152,
13,
11201,
7,
34846,
8,
198,
220,
220,
220,
458,
83,
13,
29487,
7,
88,
11,
872,
72,
11,
6167,
11639,
38200,
13370,
11537,
198,
220,
220,
220,
458,
83,
13,
1455,
437,
7,
17946,
11639,
21037,
826,
11537,
198,
220,
220,
220,
1303,
458,
83,
13,
12860,
3419,
198,
220,
220,
220,
458,
83,
13,
21928,
5647,
10786,
3919,
62,
3919,
786,
62,
29127,
62,
87,
13,
11134,
11537,
628,
220,
220,
220,
1441,
31506,
62,
82,
14375,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1057,
62,
4679,
24086,
17,
3419,
198
] | 2.182166 | 785 |
"""
Modifications copyright (C) 2020 Michael Strobl
"""
import pprint
import configparser
pp = pprint.PrettyPrinter()
#endinit
if __name__=='__main__':
c = Config("configs/allnew_mentions_config.ini", verbose=True)
| [
37811,
198,
5841,
6637,
6634,
357,
34,
8,
12131,
3899,
30183,
2436,
198,
37811,
198,
198,
11748,
279,
4798,
198,
11748,
4566,
48610,
198,
198,
381,
796,
279,
4798,
13,
35700,
6836,
3849,
3419,
628,
220,
220,
220,
1303,
437,
15003,
198,
198,
361,
11593,
3672,
834,
855,
6,
834,
12417,
834,
10354,
198,
220,
220,
220,
269,
796,
17056,
7203,
11250,
82,
14,
439,
3605,
62,
434,
507,
62,
11250,
13,
5362,
1600,
15942,
577,
28,
17821,
8,
198
] | 2.8375 | 80 |
import pandas as pd
import dill as pickle
# sklearn
from sklearn.model_selection import train_test_split
import json
import os
import numpy as np
import matplotlib.pyplot as plt
import itertools
from collections import Counter
# sklearn
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import roc_auc_score
import scikitplot.metrics as skplt
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.utils.multiclass import unique_labels
# from this project
import utils.common as common
# Function to calculate missing values by column
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
288,
359,
355,
2298,
293,
198,
2,
1341,
35720,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
340,
861,
10141,
198,
6738,
17268,
1330,
15034,
198,
198,
2,
1341,
35720,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
1855,
11518,
3351,
36213,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
686,
66,
62,
14272,
62,
26675,
198,
11748,
629,
1134,
270,
29487,
13,
4164,
10466,
355,
1341,
489,
83,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
17923,
62,
13116,
11,
10802,
62,
6759,
8609,
198,
6738,
1341,
35720,
13,
26791,
13,
16680,
291,
31172,
1330,
3748,
62,
23912,
1424,
198,
2,
422,
428,
1628,
198,
11748,
3384,
4487,
13,
11321,
355,
2219,
628,
198,
2,
15553,
284,
15284,
4814,
3815,
416,
5721,
628,
628,
628,
628
] | 3.532934 | 167 |
"""Utility functions for interacting with the console"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Used to determine python version
import sys
#-----------------------------------------------------------------------------
# Classes and functions
#-----------------------------------------------------------------------------
def input(prompt_text):
"""
Prompt the user for input.
The input command will change depending on the version of python
installed. To maintain support for 2 and earlier, we must use
raw_input in that case. Else use input.
Parameters
----------
prompt_text : str
Prompt to display to the user.
"""
# Try to get the python version. This command is only available in
# python 2 and later, so it's important that we catch the exception
# if the command isn't found.
try:
majorversion = sys.version_info[0]
except AttributeError:
majorversion = 1
# Use the correct function to prompt the user for input depending on
# what python version the code is running in.
if majorversion >= 3:
return input(prompt_text)
else:
return raw_input(prompt_text).decode(sys.stdin.encoding)
def prompt_boolean(prompt, default=False):
"""
Prompt the user for a boolean response.
Parameters
----------
prompt : str
prompt to display to the user
default : bool, optional
response to return if none is given by the user
"""
response = input(prompt)
response = response.strip().lower()
#Catch 1, true, yes as True
if len(response) > 0 and (response == "1" or response[0] == "t" or response[0] == "y"):
return True
#Catch 0, false, no as False
elif len(response) > 0 and (response == "0" or response[0] == "f" or response[0] == "n"):
return False
else:
return default
def prompt_dictionary(choices, default_style=1, menu_comments={}):
"""
Prompt the user to chose one of many selections from a menu.
Parameters
----------
choices : dictionary
Keys - choice numbers (int)
Values - choice value (str), this is what the function will return
default_style : int, optional
Choice to select if the user doesn't respond
menu_comments : dictionary, optional
Additional comments to append to the menu as it is displayed
in the console.
Keys - choice numbers (int)
Values - comment (str), what will be appended to the
corresponding choice
"""
# Build the menu that will be displayed to the user with
# all of the options available.
prompt = ""
for key, value in choices.items():
prompt += "%d %s " % (key, value)
if key in menu_comments:
prompt += menu_comments[key]
prompt += "\n"
# Continue to ask the user for a style until an appropriate
# one is specified.
response = -1
while (not response in choices):
try:
text_response = input(prompt)
# Use default option if no input.
if len(text_response.strip()) == 0:
response = default_style
else:
response = int(text_response)
except ValueError:
print("Error: Value is not an available option. 0 selects the default.\n")
return choices[response]
| [
37811,
18274,
879,
5499,
329,
24986,
351,
262,
8624,
37811,
198,
2,
10097,
32501,
198,
2,
15069,
357,
66,
8,
2211,
11,
262,
6101,
7535,
7712,
4816,
13,
198,
2,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
13789,
13,
198,
2,
198,
2,
383,
1336,
5964,
318,
287,
262,
2393,
27975,
45761,
13,
14116,
11,
9387,
351,
428,
3788,
13,
198,
2,
10097,
32501,
198,
198,
2,
10097,
32501,
198,
2,
1846,
3742,
198,
2,
10097,
32501,
198,
198,
2,
16718,
284,
5004,
21015,
2196,
198,
11748,
25064,
198,
198,
2,
10097,
32501,
198,
2,
38884,
290,
5499,
198,
2,
10097,
32501,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
4299,
5128,
7,
16963,
457,
62,
5239,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
45965,
262,
2836,
329,
5128,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
383,
5128,
3141,
481,
1487,
6906,
319,
262,
2196,
286,
21015,
198,
220,
220,
220,
6589,
13,
220,
1675,
5529,
1104,
329,
362,
290,
2961,
11,
356,
1276,
779,
198,
220,
220,
220,
8246,
62,
15414,
287,
326,
1339,
13,
220,
25974,
779,
5128,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
6152,
62,
5239,
1058,
965,
198,
220,
220,
220,
220,
220,
220,
220,
45965,
284,
3359,
284,
262,
2836,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
9993,
284,
651,
262,
21015,
2196,
13,
220,
770,
3141,
318,
691,
1695,
287,
198,
220,
220,
220,
1303,
21015,
362,
290,
1568,
11,
523,
340,
338,
1593,
326,
356,
4929,
262,
6631,
198,
220,
220,
220,
1303,
611,
262,
3141,
2125,
470,
1043,
13,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1688,
9641,
796,
25064,
13,
9641,
62,
10951,
58,
15,
60,
198,
220,
220,
220,
2845,
3460,
4163,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1688,
9641,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
5765,
262,
3376,
2163,
284,
6152,
262,
2836,
329,
5128,
6906,
319,
220,
198,
220,
220,
220,
1303,
644,
21015,
2196,
262,
2438,
318,
2491,
287,
13,
198,
220,
220,
220,
611,
1688,
9641,
18189,
513,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
5128,
7,
16963,
457,
62,
5239,
8,
220,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
8246,
62,
15414,
7,
16963,
457,
62,
5239,
737,
12501,
1098,
7,
17597,
13,
19282,
259,
13,
12685,
7656,
8,
628,
220,
220,
220,
220,
198,
4299,
6152,
62,
2127,
21052,
7,
16963,
457,
11,
4277,
28,
25101,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
45965,
262,
2836,
329,
257,
25131,
2882,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
6152,
1058,
965,
198,
220,
220,
220,
220,
220,
220,
220,
6152,
284,
3359,
284,
262,
2836,
198,
220,
220,
220,
4277,
1058,
20512,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
284,
1441,
611,
4844,
318,
1813,
416,
262,
2836,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
198,
220,
220,
220,
2882,
796,
5128,
7,
16963,
457,
8,
198,
220,
220,
220,
2882,
796,
2882,
13,
36311,
22446,
21037,
3419,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
34,
963,
352,
11,
2081,
11,
3763,
355,
6407,
198,
220,
220,
220,
611,
18896,
7,
26209,
8,
1875,
657,
290,
357,
26209,
6624,
366,
16,
1,
393,
2882,
58,
15,
60,
6624,
366,
83,
1,
393,
2882,
58,
15,
60,
6624,
366,
88,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
34,
963,
657,
11,
3991,
11,
645,
355,
10352,
198,
220,
220,
220,
1288,
361,
18896,
7,
26209,
8,
1875,
657,
290,
357,
26209,
6624,
366,
15,
1,
393,
2882,
58,
15,
60,
6624,
366,
69,
1,
393,
2882,
58,
15,
60,
6624,
366,
77,
1,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
4277,
628,
198,
4299,
6152,
62,
67,
14188,
7,
6679,
1063,
11,
4277,
62,
7635,
28,
16,
11,
6859,
62,
15944,
34758,
92,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
45965,
262,
2836,
284,
7690,
530,
286,
867,
28224,
422,
257,
6859,
13,
198,
220,
220,
220,
220,
198,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
198,
220,
220,
220,
7747,
1058,
22155,
198,
220,
220,
220,
220,
220,
220,
220,
26363,
532,
3572,
3146,
357,
600,
8,
198,
220,
220,
220,
220,
220,
220,
220,
27068,
532,
3572,
1988,
357,
2536,
828,
428,
318,
644,
262,
2163,
481,
1441,
198,
220,
220,
220,
4277,
62,
7635,
1058,
493,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
18502,
284,
2922,
611,
262,
2836,
1595,
470,
3031,
198,
220,
220,
220,
6859,
62,
15944,
1058,
22155,
11,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
15891,
3651,
284,
24443,
284,
262,
6859,
355,
340,
318,
9066,
198,
220,
220,
220,
220,
220,
220,
220,
287,
262,
8624,
13,
198,
220,
220,
220,
220,
220,
220,
220,
26363,
532,
3572,
3146,
357,
600,
8,
198,
220,
220,
220,
220,
220,
220,
220,
27068,
532,
2912,
357,
2536,
828,
644,
481,
307,
598,
1631,
284,
262,
220,
198,
220,
220,
220,
220,
220,
220,
220,
11188,
3572,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
10934,
262,
6859,
326,
481,
307,
9066,
284,
262,
2836,
351,
198,
220,
220,
220,
1303,
477,
286,
262,
3689,
1695,
13,
220,
198,
220,
220,
220,
6152,
796,
13538,
198,
220,
220,
220,
329,
1994,
11,
1988,
287,
7747,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
6152,
15853,
36521,
67,
4064,
82,
366,
4064,
357,
2539,
11,
1988,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1994,
287,
6859,
62,
15944,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6152,
15853,
6859,
62,
15944,
58,
2539,
60,
198,
220,
220,
220,
220,
220,
220,
220,
6152,
15853,
37082,
77,
1,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
10054,
284,
1265,
262,
2836,
329,
257,
3918,
1566,
281,
5035,
198,
220,
220,
220,
1303,
530,
318,
7368,
13,
198,
220,
220,
220,
2882,
796,
532,
16,
198,
220,
220,
220,
981,
357,
1662,
2882,
287,
7747,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
62,
26209,
796,
5128,
7,
16963,
457,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5765,
4277,
3038,
611,
645,
5128,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
5239,
62,
26209,
13,
36311,
28955,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
4277,
62,
7635,
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,
2882,
796,
493,
7,
5239,
62,
26209,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
11052,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
12331,
25,
11052,
318,
407,
281,
1695,
3038,
13,
220,
657,
40573,
262,
4277,
13,
59,
77,
4943,
198,
220,
220,
220,
1441,
7747,
58,
26209,
60,
198
] | 2.947955 | 1,345 |
# coding=utf-8
from os import sys, path
from logging import getLogger
from items.view import app
sys.path.append(path.dirname(path.abspath(__file__)))
logger = getLogger(__name__)
logger.info(sys.path)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080)
| [
2,
19617,
28,
40477,
12,
23,
198,
198,
6738,
28686,
1330,
25064,
11,
3108,
198,
6738,
18931,
1330,
651,
11187,
1362,
198,
198,
6738,
3709,
13,
1177,
1330,
598,
198,
198,
17597,
13,
6978,
13,
33295,
7,
6978,
13,
15908,
3672,
7,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
22305,
198,
198,
6404,
1362,
796,
651,
11187,
1362,
7,
834,
3672,
834,
8,
198,
6404,
1362,
13,
10951,
7,
17597,
13,
6978,
8,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
598,
13,
5143,
7,
4774,
11639,
15,
13,
15,
13,
15,
13,
15,
3256,
2493,
28,
1795,
1795,
8,
628,
628,
628
] | 2.469027 | 113 |
from lib import action
| [
6738,
9195,
1330,
2223,
628
] | 4.8 | 5 |
"""
********************************************************************************
* Name: gen_commands.py
* Author: Nathan Swain
* Created On: 2015
* Copyright: (c) Brigham Young University 2015
* License: BSD 2-Clause
********************************************************************************
"""
import os
import string
import random
from tethys_apps.utilities import get_tethys_home_dir, get_tethys_src_dir
from distro import linux_distribution
from django.conf import settings
from jinja2 import Template
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tethys_portal.settings")
GEN_SETTINGS_OPTION = 'settings'
GEN_APACHE_OPTION = 'apache'
GEN_ASGI_SERVICE_OPTION = 'asgi_service'
GEN_NGINX_OPTION = 'nginx'
GEN_NGINX_SERVICE_OPTION = 'nginx_service'
GEN_PORTAL_OPTION = 'portal'
GEN_SERVICES_OPTION = 'services'
GEN_INSTALL_OPTION = 'install'
GEN_SITE_YAML_OPTION = 'site_content'
FILE_NAMES = {
GEN_SETTINGS_OPTION: 'settings.py',
GEN_APACHE_OPTION: 'tethys-default.conf',
GEN_ASGI_SERVICE_OPTION: 'asgi_supervisord.conf',
GEN_NGINX_OPTION: 'tethys_nginx.conf',
GEN_NGINX_SERVICE_OPTION: 'nginx_supervisord.conf',
GEN_PORTAL_OPTION: 'portal.yml',
GEN_SERVICES_OPTION: 'services.yml',
GEN_INSTALL_OPTION: 'install.yml',
GEN_SITE_YAML_OPTION: 'site_content.yml',
}
VALID_GEN_OBJECTS = (
GEN_SETTINGS_OPTION,
# GEN_APACHE_OPTION,
GEN_ASGI_SERVICE_OPTION,
GEN_NGINX_OPTION,
GEN_NGINX_SERVICE_OPTION,
GEN_PORTAL_OPTION,
GEN_SERVICES_OPTION,
GEN_INSTALL_OPTION,
GEN_SITE_YAML_OPTION
)
TETHYS_SRC = get_tethys_src_dir()
gen_commands = {
GEN_SETTINGS_OPTION: gen_settings,
GEN_ASGI_SERVICE_OPTION: gen_asgi_service,
GEN_NGINX_OPTION: gen_nginx,
GEN_NGINX_SERVICE_OPTION: gen_nginx_service,
GEN_PORTAL_OPTION: gen_portal_yaml,
GEN_SERVICES_OPTION: gen_services_yaml,
GEN_INSTALL_OPTION: gen_install,
GEN_SITE_YAML_OPTION: gen_site_content_yaml,
}
def generate_command(args):
"""
Generate a settings file for a new installation.
"""
# Setup variables
context = gen_commands[args.type](args)
destination_path = get_destination_path(args)
render_template(args.type, context, destination_path)
| [
37811,
198,
17174,
17174,
8412,
198,
9,
6530,
25,
2429,
62,
9503,
1746,
13,
9078,
198,
9,
6434,
25,
18106,
2451,
391,
198,
9,
15622,
1550,
25,
1853,
198,
9,
15069,
25,
357,
66,
8,
37434,
6960,
2059,
1853,
198,
9,
13789,
25,
347,
10305,
362,
12,
2601,
682,
198,
17174,
17174,
8412,
198,
37811,
198,
11748,
28686,
198,
11748,
4731,
198,
11748,
4738,
198,
6738,
256,
2788,
893,
62,
18211,
13,
315,
2410,
1330,
651,
62,
83,
2788,
893,
62,
11195,
62,
15908,
11,
651,
62,
83,
2788,
893,
62,
10677,
62,
15908,
198,
6738,
1233,
305,
1330,
32639,
62,
17080,
3890,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
474,
259,
6592,
17,
1330,
37350,
628,
198,
418,
13,
268,
2268,
13,
2617,
12286,
7203,
35028,
1565,
11230,
62,
28480,
51,
20754,
62,
33365,
24212,
1600,
366,
83,
2788,
893,
62,
634,
282,
13,
33692,
4943,
628,
198,
35353,
62,
28480,
51,
20754,
62,
3185,
24131,
796,
705,
33692,
6,
198,
35353,
62,
2969,
2246,
13909,
62,
3185,
24131,
796,
705,
43073,
6,
198,
35353,
62,
1921,
18878,
62,
35009,
27389,
62,
3185,
24131,
796,
705,
292,
12397,
62,
15271,
6,
198,
35353,
62,
10503,
1268,
55,
62,
3185,
24131,
796,
705,
782,
28413,
6,
198,
35353,
62,
10503,
1268,
55,
62,
35009,
27389,
62,
3185,
24131,
796,
705,
782,
28413,
62,
15271,
6,
198,
35353,
62,
15490,
1847,
62,
3185,
24131,
796,
705,
634,
282,
6,
198,
35353,
62,
35009,
53,
34444,
62,
3185,
24131,
796,
705,
30416,
6,
198,
35353,
62,
38604,
7036,
62,
3185,
24131,
796,
705,
17350,
6,
198,
35353,
62,
50,
12709,
62,
56,
2390,
43,
62,
3185,
24131,
796,
705,
15654,
62,
11299,
6,
198,
198,
25664,
62,
45,
29559,
796,
1391,
198,
220,
220,
220,
24700,
62,
28480,
51,
20754,
62,
3185,
24131,
25,
705,
33692,
13,
9078,
3256,
198,
220,
220,
220,
24700,
62,
2969,
2246,
13909,
62,
3185,
24131,
25,
705,
83,
2788,
893,
12,
12286,
13,
10414,
3256,
198,
220,
220,
220,
24700,
62,
1921,
18878,
62,
35009,
27389,
62,
3185,
24131,
25,
705,
292,
12397,
62,
16668,
4703,
585,
13,
10414,
3256,
198,
220,
220,
220,
24700,
62,
10503,
1268,
55,
62,
3185,
24131,
25,
705,
83,
2788,
893,
62,
782,
28413,
13,
10414,
3256,
198,
220,
220,
220,
24700,
62,
10503,
1268,
55,
62,
35009,
27389,
62,
3185,
24131,
25,
705,
782,
28413,
62,
16668,
4703,
585,
13,
10414,
3256,
198,
220,
220,
220,
24700,
62,
15490,
1847,
62,
3185,
24131,
25,
705,
634,
282,
13,
88,
4029,
3256,
198,
220,
220,
220,
24700,
62,
35009,
53,
34444,
62,
3185,
24131,
25,
705,
30416,
13,
88,
4029,
3256,
198,
220,
220,
220,
24700,
62,
38604,
7036,
62,
3185,
24131,
25,
705,
17350,
13,
88,
4029,
3256,
198,
220,
220,
220,
24700,
62,
50,
12709,
62,
56,
2390,
43,
62,
3185,
24131,
25,
705,
15654,
62,
11299,
13,
88,
4029,
3256,
198,
92,
198,
198,
23428,
2389,
62,
35353,
62,
9864,
41,
2943,
4694,
796,
357,
198,
220,
220,
220,
24700,
62,
28480,
51,
20754,
62,
3185,
24131,
11,
198,
220,
220,
220,
1303,
24700,
62,
2969,
2246,
13909,
62,
3185,
24131,
11,
198,
220,
220,
220,
24700,
62,
1921,
18878,
62,
35009,
27389,
62,
3185,
24131,
11,
198,
220,
220,
220,
24700,
62,
10503,
1268,
55,
62,
3185,
24131,
11,
198,
220,
220,
220,
24700,
62,
10503,
1268,
55,
62,
35009,
27389,
62,
3185,
24131,
11,
198,
220,
220,
220,
24700,
62,
15490,
1847,
62,
3185,
24131,
11,
198,
220,
220,
220,
24700,
62,
35009,
53,
34444,
62,
3185,
24131,
11,
198,
220,
220,
220,
24700,
62,
38604,
7036,
62,
3185,
24131,
11,
198,
220,
220,
220,
24700,
62,
50,
12709,
62,
56,
2390,
43,
62,
3185,
24131,
198,
8,
198,
198,
51,
20702,
16309,
62,
50,
7397,
796,
651,
62,
83,
2788,
893,
62,
10677,
62,
15908,
3419,
628,
628,
628,
628,
628,
628,
628,
628,
198,
5235,
62,
9503,
1746,
796,
1391,
198,
220,
220,
220,
24700,
62,
28480,
51,
20754,
62,
3185,
24131,
25,
2429,
62,
33692,
11,
198,
220,
220,
220,
24700,
62,
1921,
18878,
62,
35009,
27389,
62,
3185,
24131,
25,
2429,
62,
292,
12397,
62,
15271,
11,
198,
220,
220,
220,
24700,
62,
10503,
1268,
55,
62,
3185,
24131,
25,
2429,
62,
782,
28413,
11,
198,
220,
220,
220,
24700,
62,
10503,
1268,
55,
62,
35009,
27389,
62,
3185,
24131,
25,
2429,
62,
782,
28413,
62,
15271,
11,
198,
220,
220,
220,
24700,
62,
15490,
1847,
62,
3185,
24131,
25,
2429,
62,
634,
282,
62,
88,
43695,
11,
198,
220,
220,
220,
24700,
62,
35009,
53,
34444,
62,
3185,
24131,
25,
2429,
62,
30416,
62,
88,
43695,
11,
198,
220,
220,
220,
24700,
62,
38604,
7036,
62,
3185,
24131,
25,
2429,
62,
17350,
11,
198,
220,
220,
220,
24700,
62,
50,
12709,
62,
56,
2390,
43,
62,
3185,
24131,
25,
2429,
62,
15654,
62,
11299,
62,
88,
43695,
11,
198,
92,
628,
198,
4299,
7716,
62,
21812,
7,
22046,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2980,
378,
257,
6460,
2393,
329,
257,
649,
9988,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
31122,
9633,
198,
220,
220,
220,
4732,
796,
2429,
62,
9503,
1746,
58,
22046,
13,
4906,
16151,
22046,
8,
628,
220,
220,
220,
10965,
62,
6978,
796,
651,
62,
16520,
1883,
62,
6978,
7,
22046,
8,
628,
220,
220,
220,
8543,
62,
28243,
7,
22046,
13,
4906,
11,
4732,
11,
10965,
62,
6978,
8,
198
] | 2.461287 | 917 |
if __name__ == "__main__":
grid = [[0 for x in range(9)] for y in range(9)]
grid = [[3, 0, 6, 5, 0, 8, 4, 0, 0],
[5, 2, 0, 0, 0, 0, 0, 0, 0],
[0, 8, 7, 0, 0, 0, 0, 3, 1],
[0, 0, 3, 0, 1, 0, 0, 8, 0],
[9, 0, 0, 8, 6, 3, 0, 0, 5],
[0, 5, 0, 0, 9, 0, 6, 0, 0],
[1, 3, 0, 0, 0, 0, 2, 5, 0],
[0, 0, 0, 0, 0, 0, 0, 7, 4],
[0, 0, 5, 2, 0, 6, 3, 0, 0]]
if (solve_sudoku(grid)):
print_grid(grid)
else:
print
"No solution exists"
| [
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
201,
198,
201,
198,
220,
220,
220,
10706,
796,
16410,
15,
329,
2124,
287,
2837,
7,
24,
15437,
329,
331,
287,
2837,
7,
24,
15437,
201,
198,
201,
198,
220,
220,
220,
10706,
796,
16410,
18,
11,
657,
11,
718,
11,
642,
11,
657,
11,
807,
11,
604,
11,
657,
11,
657,
4357,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
20,
11,
362,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
4357,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
807,
11,
767,
11,
657,
11,
657,
11,
657,
11,
657,
11,
513,
11,
352,
4357,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
657,
11,
513,
11,
657,
11,
352,
11,
657,
11,
657,
11,
807,
11,
657,
4357,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
24,
11,
657,
11,
657,
11,
807,
11,
718,
11,
513,
11,
657,
11,
657,
11,
642,
4357,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
642,
11,
657,
11,
657,
11,
860,
11,
657,
11,
718,
11,
657,
11,
657,
4357,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
16,
11,
513,
11,
657,
11,
657,
11,
657,
11,
657,
11,
362,
11,
642,
11,
657,
4357,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
657,
11,
767,
11,
604,
4357,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
657,
11,
642,
11,
362,
11,
657,
11,
718,
11,
513,
11,
657,
11,
657,
11907,
201,
198,
201,
198,
220,
220,
220,
611,
357,
82,
6442,
62,
82,
463,
11601,
7,
25928,
8,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
62,
25928,
7,
25928,
8,
201,
198,
220,
220,
220,
2073,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
201,
198,
220,
220,
220,
220,
220,
220,
220,
366,
2949,
4610,
7160,
1,
201,
198
] | 1.477612 | 402 |
# -*- coding: utf-8 -*-
#
# Hymn documentation build configuration file
import os
import sys
PROJECT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
sys.path.insert(0, PROJECT_DIR)
import hymn
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
]
source_suffix = '.rst'
master_doc = 'index'
project = u'Hymn'
copyright = u'2014-2018, Philip Xu'
author = u'Philip Xu'
version = '%d.%d' % hymn.__version__
release = hymn.VERSION
language = None
exclude_patterns = ['_build']
pygments_style = 'colorful'
todo_include_todos = False
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd:
html_theme = 'bizstyle'
htmlhelp_basename = 'Hymndoc'
latex_documents = [
(master_doc, 'Hymn.tex', u'Hymn Documentation',
u'Philip Xu', 'manual'),
]
man_pages = [
(master_doc, 'hymn', u'Hymn Documentation',
[author], 1)
]
texinfo_documents = [
(master_doc, 'Hymn', u'Hymn Documentation',
author, 'Hymn', hymn.__doc__,
'Miscellaneous'),
]
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
367,
4948,
77,
10314,
1382,
8398,
2393,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
31190,
23680,
62,
34720,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
705,
40720,
6,
4008,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
21965,
23680,
62,
34720,
8,
198,
11748,
2537,
10295,
198,
198,
2302,
5736,
796,
685,
198,
220,
220,
220,
705,
82,
746,
28413,
13,
2302,
13,
2306,
375,
420,
3256,
198,
220,
220,
220,
705,
82,
746,
28413,
13,
2302,
13,
1073,
1857,
3256,
198,
220,
220,
220,
705,
82,
746,
28413,
13,
2302,
13,
1177,
8189,
3256,
198,
60,
198,
198,
10459,
62,
37333,
844,
796,
45302,
81,
301,
6,
198,
198,
9866,
62,
15390,
796,
705,
9630,
6,
198,
198,
16302,
796,
334,
6,
39,
4948,
77,
6,
198,
22163,
4766,
796,
334,
6,
4967,
12,
7908,
11,
14576,
33591,
6,
198,
9800,
796,
334,
6,
18673,
541,
33591,
6,
198,
198,
9641,
796,
705,
4,
67,
13,
4,
67,
6,
4064,
2537,
10295,
13,
834,
9641,
834,
198,
20979,
796,
2537,
10295,
13,
43717,
198,
198,
16129,
796,
6045,
198,
198,
1069,
9152,
62,
33279,
82,
796,
37250,
62,
11249,
20520,
198,
198,
9078,
11726,
62,
7635,
796,
705,
8043,
913,
6,
198,
198,
83,
24313,
62,
17256,
62,
83,
375,
418,
796,
10352,
198,
198,
261,
62,
81,
8671,
796,
28686,
13,
268,
2268,
13,
1136,
10786,
15675,
4221,
1961,
4503,
50,
3256,
6045,
8,
6624,
705,
17821,
6,
198,
198,
361,
407,
319,
62,
81,
8671,
25,
198,
220,
220,
220,
27711,
62,
43810,
796,
705,
42189,
7635,
6,
198,
198,
6494,
16794,
62,
12093,
12453,
796,
705,
39,
4948,
358,
420,
6,
198,
198,
17660,
87,
62,
15390,
2886,
796,
685,
198,
220,
357,
9866,
62,
15390,
11,
705,
39,
4948,
77,
13,
16886,
3256,
334,
6,
39,
4948,
77,
43925,
3256,
198,
220,
220,
334,
6,
18673,
541,
33591,
3256,
705,
805,
723,
33809,
198,
60,
198,
198,
805,
62,
31126,
796,
685,
198,
220,
220,
220,
357,
9866,
62,
15390,
11,
705,
71,
4948,
77,
3256,
334,
6,
39,
4948,
77,
43925,
3256,
198,
220,
220,
220,
220,
685,
9800,
4357,
352,
8,
198,
60,
198,
198,
16886,
10951,
62,
15390,
2886,
796,
685,
198,
220,
357,
9866,
62,
15390,
11,
705,
39,
4948,
77,
3256,
334,
6,
39,
4948,
77,
43925,
3256,
198,
220,
220,
1772,
11,
705,
39,
4948,
77,
3256,
2537,
10295,
13,
834,
15390,
834,
11,
198,
220,
220,
705,
31281,
25673,
33809,
198,
60,
198
] | 2.302428 | 453 |
# coding=utf-8
from services.base import BaseService
from services.service_locator import ServiceLocator
from logger import error
__author__ = 'Glebov Boris'
| [
2,
19617,
28,
40477,
12,
23,
198,
198,
6738,
2594,
13,
8692,
1330,
7308,
16177,
198,
6738,
2594,
13,
15271,
62,
17946,
1352,
1330,
4809,
33711,
1352,
198,
6738,
49706,
1330,
4049,
198,
198,
834,
9800,
834,
796,
705,
38,
293,
65,
709,
25026,
6,
628
] | 3.5 | 46 |
import os
from typing import List
import random
import h5py
import numpy as np
from PIL import Image, ImageFile
import threading
# force pillow to load also truncated images
ImageFile.LOAD_TRUNCATED_IMAGES = True
# number of images to take from the folder
N_EL = int(5e5)
# path/to/folder that contains the images. No particular structure is required and nested folder are accepted.
RES_PATH = os.path.join('E:\\dataset\\images_only')
def square_img(im: Image.Image) -> Image:
"""
:param im:
:return:
"""
w, h = im.size
if w == h:
return im
crop_shift = random.randrange(abs(h-w)) # crops only in the dimension that is bigger!
if w > h:
# left-upper, right-lower
# box dimension must be that way
box = [0, 0, h, h]
# and it may be moved horizontally
box[0] += crop_shift
box[2] += crop_shift
else:
# moving box vertically
box = [0, 0, w, w]
box[1] += crop_shift
box[3] += crop_shift
im = im.crop(box)
return im
class ThreadedImageWriter(threading.Thread):
"""
Threaded version to prepare the dataset. Everything runs smoothly because we have multiple folders that avoid
race conditions
"""
def images_in_paths(folder_path: str) -> List[str]:
"""
Collects all images from one folder and return a list of paths
:param folder_path:
:return:
"""
paths = []
folder_path = os.path.join(os.getcwd(), folder_path)
for root, dirs, files in os.walk(folder_path):
for file in files:
paths.append(os.path.join(root, file))
return paths
def shuffle_dataset(lst: List, seed: int = None) -> None:
"""
Controlled shuffle.
:param lst:
:param seed: if specified the shuffle returns the same shuffled list every time it is invoked
:return:
"""
if seed is not None:
random.seed(seed)
random.shuffle(lst)
def generate_dataset(file_list: List, dataset_folder: str, img_size=256, train_dim: float = 0.70, val_dim: float = 0.25):
"""
Generate and save train, validation and test data. Test data is what is left from train and validation sets
:param file_list:
:param img_size:
:param train_dim:
:param val_dim:
:param hdf5_file_name:
:return:
"""
shuffle_dataset(file_list)
# make train, validation and test partitions
n = len(file_list)
train_i = [0, int(train_dim*n)]
val_i = [int(train_dim*n), int((train_dim+val_dim)*n)]
test_i = [int((train_dim+val_dim)*n), -1]
file_dict = {
'train': file_list[train_i[0]:train_i[1]],
'val': file_list[val_i[0]:val_i[1]],
'test': file_list[test_i[0]:]
}
# it is better to keep validation dataset bigger than test one
assert len(file_dict['train']) > len(file_dict['val']) > len(file_dict['test'])
os.makedirs(dataset_folder, exist_ok=True)
# create h5file to store information about train_mean and train_std that are useful for training later
h5_path = os.path.join(dataset_folder, 'info.h5')
with h5py.File(h5_path, mode='w') as hdf5_out:
hdf5_out.create_dataset('train_mean', (img_size, img_size, 3), np.float32)
hdf5_out.create_dataset('train_std', (img_size, img_size, 3), np.float32)
hdf5_out.create_dataset('train_dim', (), np.int32, data=int(n*train_dim))
hdf5_out.create_dataset('val_dim', (), np.int32, data=int(n*val_dim))
hdf5_out.create_dataset('test_dim', (), np.int32, data=int(n*(1-train_dim-val_dim)))
# make one thread for <set_type>
threaded_types = []
for set_type, img_list in file_dict.items():
threaded_types.append(ThreadedImageWriter(img_list, set_type, hdf5_out, img_size, dataset_folder))
for thread in threaded_types:
thread.start()
for thread in threaded_types:
# wait for the threads to finish the execution
thread.join()
for i, thread in enumerate(threaded_types):
if thread.read_errors:
with open('errors{}.txt'.format(i), 'w') as f:
f.writelines(thread.read_errors)
if thread.set_type == 'train':
# calculate the std using the variace array only for train set
training_std = np.sqrt(thread.M2 / (len(file_dict['train']) - 1))
hdf5_out['train_mean'][...] = thread.mean
hdf5_out['train_std'][...] = training_std
if __name__ == '__main__':
output_path = os.path.join(os.getcwd(), 'resources', 'images')
elements = N_EL
res_path = RES_PATH
images_list = images_in_paths(os.path.join(res_path))
random.shuffle(images_list)
images_list = images_list[0:elements]
generate_dataset(images_list, os.path.join(output_path, 'ILSVRC_' + str(elements)))
| [
11748,
28686,
198,
6738,
19720,
1330,
7343,
198,
11748,
4738,
198,
11748,
289,
20,
9078,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
8979,
198,
11748,
4704,
278,
198,
2,
2700,
28774,
284,
3440,
635,
40122,
515,
4263,
198,
5159,
8979,
13,
35613,
62,
5446,
4944,
34,
11617,
62,
3955,
25552,
796,
6407,
198,
198,
2,
1271,
286,
4263,
284,
1011,
422,
262,
9483,
198,
45,
62,
3698,
796,
493,
7,
20,
68,
20,
8,
198,
2,
3108,
14,
1462,
14,
43551,
326,
4909,
262,
4263,
13,
1400,
1948,
4645,
318,
2672,
290,
28376,
9483,
389,
6292,
13,
198,
19535,
62,
34219,
796,
28686,
13,
6978,
13,
22179,
10786,
36,
25,
6852,
19608,
292,
316,
6852,
17566,
62,
8807,
11537,
628,
198,
4299,
6616,
62,
9600,
7,
320,
25,
7412,
13,
5159,
8,
4613,
7412,
25,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1058,
17143,
545,
25,
198,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
266,
11,
289,
796,
545,
13,
7857,
198,
220,
220,
220,
611,
266,
6624,
289,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
545,
198,
220,
220,
220,
13833,
62,
30846,
796,
4738,
13,
25192,
9521,
7,
8937,
7,
71,
12,
86,
4008,
220,
1303,
14450,
691,
287,
262,
15793,
326,
318,
5749,
0,
198,
220,
220,
220,
611,
266,
1875,
289,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1364,
12,
45828,
11,
826,
12,
21037,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3091,
15793,
1276,
307,
326,
835,
198,
220,
220,
220,
220,
220,
220,
220,
3091,
796,
685,
15,
11,
657,
11,
289,
11,
289,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
290,
340,
743,
307,
3888,
36774,
198,
220,
220,
220,
220,
220,
220,
220,
3091,
58,
15,
60,
15853,
13833,
62,
30846,
198,
220,
220,
220,
220,
220,
220,
220,
3091,
58,
17,
60,
15853,
13833,
62,
30846,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3867,
3091,
31677,
198,
220,
220,
220,
220,
220,
220,
220,
3091,
796,
685,
15,
11,
657,
11,
266,
11,
266,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3091,
58,
16,
60,
15853,
13833,
62,
30846,
198,
220,
220,
220,
220,
220,
220,
220,
3091,
58,
18,
60,
15853,
13833,
62,
30846,
198,
220,
220,
220,
545,
796,
545,
13,
31476,
7,
3524,
8,
198,
220,
220,
220,
1441,
545,
628,
198,
4871,
14122,
276,
5159,
34379,
7,
16663,
278,
13,
16818,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
14122,
276,
2196,
284,
8335,
262,
27039,
13,
11391,
4539,
21461,
780,
356,
423,
3294,
24512,
326,
3368,
198,
220,
220,
220,
3234,
3403,
198,
220,
220,
220,
37227,
628,
198,
4299,
4263,
62,
259,
62,
6978,
82,
7,
43551,
62,
6978,
25,
965,
8,
4613,
7343,
58,
2536,
5974,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9745,
82,
477,
4263,
422,
530,
9483,
290,
1441,
257,
1351,
286,
13532,
198,
220,
220,
220,
1058,
17143,
9483,
62,
6978,
25,
198,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13532,
796,
17635,
198,
220,
220,
220,
9483,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
1136,
66,
16993,
22784,
9483,
62,
6978,
8,
198,
220,
220,
220,
329,
6808,
11,
288,
17062,
11,
3696,
287,
28686,
13,
11152,
7,
43551,
62,
6978,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2393,
287,
3696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13532,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
15763,
11,
2393,
4008,
198,
220,
220,
220,
1441,
13532,
628,
198,
4299,
36273,
62,
19608,
292,
316,
7,
75,
301,
25,
7343,
11,
9403,
25,
493,
796,
6045,
8,
4613,
6045,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
43253,
36273,
13,
198,
220,
220,
220,
1058,
17143,
300,
301,
25,
198,
220,
220,
220,
1058,
17143,
9403,
25,
611,
7368,
262,
36273,
5860,
262,
976,
32299,
992,
1351,
790,
640,
340,
318,
24399,
198,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
9403,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4738,
13,
28826,
7,
28826,
8,
198,
220,
220,
220,
4738,
13,
1477,
18137,
7,
75,
301,
8,
628,
198,
4299,
7716,
62,
19608,
292,
316,
7,
7753,
62,
4868,
25,
7343,
11,
27039,
62,
43551,
25,
965,
11,
33705,
62,
7857,
28,
11645,
11,
4512,
62,
27740,
25,
12178,
796,
657,
13,
2154,
11,
1188,
62,
27740,
25,
12178,
796,
657,
13,
1495,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2980,
378,
290,
3613,
4512,
11,
21201,
290,
1332,
1366,
13,
6208,
1366,
318,
644,
318,
1364,
422,
4512,
290,
21201,
5621,
198,
220,
220,
220,
1058,
17143,
2393,
62,
4868,
25,
198,
220,
220,
220,
1058,
17143,
33705,
62,
7857,
25,
198,
220,
220,
220,
1058,
17143,
4512,
62,
27740,
25,
198,
220,
220,
220,
1058,
17143,
1188,
62,
27740,
25,
198,
220,
220,
220,
1058,
17143,
289,
7568,
20,
62,
7753,
62,
3672,
25,
198,
220,
220,
220,
1058,
7783,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
36273,
62,
19608,
292,
316,
7,
7753,
62,
4868,
8,
198,
220,
220,
220,
1303,
787,
4512,
11,
21201,
290,
1332,
43869,
198,
220,
220,
220,
299,
796,
18896,
7,
7753,
62,
4868,
8,
198,
220,
220,
220,
4512,
62,
72,
796,
685,
15,
11,
493,
7,
27432,
62,
27740,
9,
77,
15437,
198,
220,
220,
220,
1188,
62,
72,
796,
685,
600,
7,
27432,
62,
27740,
9,
77,
828,
493,
19510,
27432,
62,
27740,
10,
2100,
62,
27740,
27493,
77,
15437,
198,
220,
220,
220,
1332,
62,
72,
796,
685,
600,
19510,
27432,
62,
27740,
10,
2100,
62,
27740,
27493,
77,
828,
532,
16,
60,
198,
220,
220,
220,
2393,
62,
11600,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
27432,
10354,
2393,
62,
4868,
58,
27432,
62,
72,
58,
15,
5974,
27432,
62,
72,
58,
16,
60,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
2100,
10354,
2393,
62,
4868,
58,
2100,
62,
72,
58,
15,
5974,
2100,
62,
72,
58,
16,
60,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
705,
9288,
10354,
2393,
62,
4868,
58,
9288,
62,
72,
58,
15,
5974,
60,
198,
220,
220,
220,
1782,
628,
220,
220,
220,
1303,
340,
318,
1365,
284,
1394,
21201,
27039,
5749,
621,
1332,
530,
198,
220,
220,
220,
6818,
18896,
7,
7753,
62,
11600,
17816,
27432,
6,
12962,
1875,
18896,
7,
7753,
62,
11600,
17816,
2100,
6,
12962,
1875,
18896,
7,
7753,
62,
11600,
17816,
9288,
6,
12962,
628,
220,
220,
220,
28686,
13,
76,
4335,
17062,
7,
19608,
292,
316,
62,
43551,
11,
2152,
62,
482,
28,
17821,
8,
628,
220,
220,
220,
1303,
2251,
289,
20,
7753,
284,
3650,
1321,
546,
4512,
62,
32604,
290,
4512,
62,
19282,
326,
389,
4465,
329,
3047,
1568,
198,
220,
220,
220,
289,
20,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
19608,
292,
316,
62,
43551,
11,
705,
10951,
13,
71,
20,
11537,
198,
220,
220,
220,
351,
289,
20,
9078,
13,
8979,
7,
71,
20,
62,
6978,
11,
4235,
11639,
86,
11537,
355,
289,
7568,
20,
62,
448,
25,
198,
220,
220,
220,
220,
220,
220,
220,
289,
7568,
20,
62,
448,
13,
17953,
62,
19608,
292,
316,
10786,
27432,
62,
32604,
3256,
357,
9600,
62,
7857,
11,
33705,
62,
7857,
11,
513,
828,
45941,
13,
22468,
2624,
8,
198,
220,
220,
220,
220,
220,
220,
220,
289,
7568,
20,
62,
448,
13,
17953,
62,
19608,
292,
316,
10786,
27432,
62,
19282,
3256,
357,
9600,
62,
7857,
11,
33705,
62,
7857,
11,
513,
828,
45941,
13,
22468,
2624,
8,
198,
220,
220,
220,
220,
220,
220,
220,
289,
7568,
20,
62,
448,
13,
17953,
62,
19608,
292,
316,
10786,
27432,
62,
27740,
3256,
29994,
45941,
13,
600,
2624,
11,
1366,
28,
600,
7,
77,
9,
27432,
62,
27740,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
289,
7568,
20,
62,
448,
13,
17953,
62,
19608,
292,
316,
10786,
2100,
62,
27740,
3256,
29994,
45941,
13,
600,
2624,
11,
1366,
28,
600,
7,
77,
9,
2100,
62,
27740,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
289,
7568,
20,
62,
448,
13,
17953,
62,
19608,
292,
316,
10786,
9288,
62,
27740,
3256,
29994,
45941,
13,
600,
2624,
11,
1366,
28,
600,
7,
77,
9,
7,
16,
12,
27432,
62,
27740,
12,
2100,
62,
27740,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
787,
530,
4704,
329,
1279,
2617,
62,
4906,
29,
198,
220,
220,
220,
220,
220,
220,
220,
40945,
62,
19199,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
329,
900,
62,
4906,
11,
33705,
62,
4868,
287,
2393,
62,
11600,
13,
23814,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
40945,
62,
19199,
13,
33295,
7,
16818,
276,
5159,
34379,
7,
9600,
62,
4868,
11,
900,
62,
4906,
11,
289,
7568,
20,
62,
448,
11,
33705,
62,
7857,
11,
27039,
62,
43551,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
329,
4704,
287,
40945,
62,
19199,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4704,
13,
9688,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
329,
4704,
287,
40945,
62,
19199,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4043,
329,
262,
14390,
284,
5461,
262,
9706,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4704,
13,
22179,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
11,
4704,
287,
27056,
378,
7,
16663,
276,
62,
19199,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4704,
13,
961,
62,
48277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
10786,
48277,
90,
27422,
14116,
4458,
18982,
7,
72,
828,
705,
86,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
277,
13,
8933,
20655,
7,
16663,
13,
961,
62,
48277,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4704,
13,
2617,
62,
4906,
6624,
705,
27432,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
15284,
262,
14367,
1262,
262,
5553,
558,
7177,
691,
329,
4512,
900,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
62,
19282,
796,
45941,
13,
31166,
17034,
7,
16663,
13,
44,
17,
1220,
357,
11925,
7,
7753,
62,
11600,
17816,
27432,
6,
12962,
532,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
289,
7568,
20,
62,
448,
17816,
27432,
62,
32604,
6,
7131,
22345,
796,
4704,
13,
32604,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
289,
7568,
20,
62,
448,
17816,
27432,
62,
19282,
6,
7131,
22345,
796,
3047,
62,
19282,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
5072,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
1136,
66,
16993,
22784,
705,
37540,
3256,
705,
17566,
11537,
198,
220,
220,
220,
4847,
796,
399,
62,
3698,
198,
220,
220,
220,
581,
62,
6978,
796,
15731,
62,
34219,
198,
220,
220,
220,
4263,
62,
4868,
796,
4263,
62,
259,
62,
6978,
82,
7,
418,
13,
6978,
13,
22179,
7,
411,
62,
6978,
4008,
198,
220,
220,
220,
4738,
13,
1477,
18137,
7,
17566,
62,
4868,
8,
198,
220,
220,
220,
4263,
62,
4868,
796,
4263,
62,
4868,
58,
15,
25,
68,
3639,
60,
198,
220,
220,
220,
7716,
62,
19608,
292,
316,
7,
17566,
62,
4868,
11,
28686,
13,
6978,
13,
22179,
7,
22915,
62,
6978,
11,
705,
45484,
53,
7397,
62,
6,
1343,
965,
7,
68,
3639,
22305,
198
] | 2.372252 | 2,047 |
import urllib.request
import os
import argparse
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser()
parser.add_argument("url", type=str, nargs=1, help="Main url with list of recipe URLs")
parser.add_argument("cuisine", type=str, nargs=1, help="Type of cuisine on the main url page")
parser.add_argument("pageNum", type=int, nargs=1, help="Page number to pull from")
#parser.add_argument("fileStart", type=int, nargs=1, help="number to start filenames on")
args = parser.parse_args()
cuisine = str(args.cuisine[0]).lower()
page = str(args.pageNum[0])
main_url = str(args.url[0]) + "?sort=Newest&page=" + page
#local_filename, headers = urllib.request.urlretrieve(main_url)
try:local_filename, headers = urllib.request.urlretrieve(main_url)
except:
print("\n### Unable to open webpage " + main_url + " ### \n")
exit(-1)
url_file = open(local_filename)
html = url_file.read()
soup = BeautifulSoup(html, 'html.parser')
div = soup.find_all('article', class_='grid-col--fixed-tiles')
url_list = []
for item in div:
for a in item.find_all('a', href=True):
if "/recipe" in a['href']:
if a['href'] not in url_list:
url_list.append(a['href'])
url_file.close()
filenum = len(os.listdir("html/" + cuisine))
for url in url_list:
if filenum > 160:
break
urlname = "http://allrecipes.com" + url
html_filename = "html/" + cuisine +"/" + cuisine + str(filenum) + ".html"
html_file = open(html_filename, 'w')
print(urlname, filenum)
try:local_filename, headers = urllib.request.urlretrieve(urlname)
except:
print("UNABLE TO OPEN " + urlname)
exit(-1)
file_ = open(local_filename)
data = file_.read()
html_file.write(data)
html_file.close()
file_.close()
filenum += 1
print("Done")
| [
11748,
2956,
297,
571,
13,
25927,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
7203,
6371,
1600,
2099,
28,
2536,
11,
299,
22046,
28,
16,
11,
1037,
2625,
13383,
19016,
351,
1351,
286,
8364,
32336,
4943,
198,
48610,
13,
2860,
62,
49140,
7203,
27399,
27480,
1600,
2099,
28,
2536,
11,
299,
22046,
28,
16,
11,
1037,
2625,
6030,
286,
33072,
319,
262,
1388,
19016,
2443,
4943,
198,
48610,
13,
2860,
62,
49140,
7203,
7700,
33111,
1600,
2099,
28,
600,
11,
299,
22046,
28,
16,
11,
1037,
2625,
9876,
1271,
284,
2834,
422,
4943,
198,
2,
48610,
13,
2860,
62,
49140,
7203,
7753,
10434,
1600,
2099,
28,
600,
11,
299,
22046,
28,
16,
11,
1037,
2625,
17618,
284,
923,
1226,
268,
1047,
319,
4943,
198,
22046,
796,
30751,
13,
29572,
62,
22046,
3419,
198,
198,
27399,
27480,
796,
965,
7,
22046,
13,
27399,
27480,
58,
15,
35944,
21037,
3419,
198,
7700,
796,
965,
7,
22046,
13,
7700,
33111,
58,
15,
12962,
198,
12417,
62,
6371,
796,
965,
7,
22046,
13,
6371,
58,
15,
12962,
1343,
366,
30,
30619,
28,
3791,
395,
5,
7700,
2625,
1343,
2443,
198,
198,
2,
12001,
62,
34345,
11,
24697,
796,
2956,
297,
571,
13,
25927,
13,
6371,
1186,
30227,
7,
12417,
62,
6371,
8,
198,
28311,
25,
12001,
62,
34345,
11,
24697,
796,
2956,
297,
571,
13,
25927,
13,
6371,
1186,
30227,
7,
12417,
62,
6371,
8,
198,
16341,
25,
198,
220,
220,
220,
3601,
7203,
59,
77,
21017,
27319,
284,
1280,
35699,
366,
1343,
1388,
62,
6371,
1343,
366,
44386,
3467,
77,
4943,
198,
220,
220,
220,
8420,
32590,
16,
8,
198,
198,
6371,
62,
7753,
796,
1280,
7,
12001,
62,
34345,
8,
198,
6494,
796,
19016,
62,
7753,
13,
961,
3419,
198,
82,
10486,
796,
23762,
50,
10486,
7,
6494,
11,
705,
6494,
13,
48610,
11537,
198,
198,
7146,
796,
17141,
13,
19796,
62,
439,
10786,
20205,
3256,
1398,
62,
11639,
25928,
12,
4033,
438,
34021,
12,
83,
2915,
11537,
198,
198,
6371,
62,
4868,
796,
17635,
198,
198,
1640,
2378,
287,
2659,
25,
198,
220,
220,
220,
329,
257,
287,
2378,
13,
19796,
62,
439,
10786,
64,
3256,
13291,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
611,
12813,
29102,
431,
1,
287,
257,
17816,
33257,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
257,
17816,
33257,
20520,
407,
287,
19016,
62,
4868,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19016,
62,
4868,
13,
33295,
7,
64,
17816,
33257,
6,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
6371,
62,
7753,
13,
19836,
3419,
198,
198,
10379,
44709,
796,
18896,
7,
418,
13,
4868,
15908,
7203,
6494,
30487,
1343,
33072,
4008,
198,
1640,
19016,
287,
19016,
62,
4868,
25,
198,
220,
220,
220,
611,
1226,
44709,
1875,
13454,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
19016,
3672,
796,
366,
4023,
1378,
439,
8344,
18636,
13,
785,
1,
1343,
19016,
198,
220,
220,
220,
27711,
62,
34345,
796,
366,
6494,
30487,
1343,
33072,
1343,
1,
30487,
1343,
33072,
1343,
965,
7,
10379,
44709,
8,
1343,
27071,
6494,
1,
628,
220,
220,
220,
27711,
62,
7753,
796,
1280,
7,
6494,
62,
34345,
11,
705,
86,
11537,
198,
220,
220,
220,
3601,
7,
6371,
3672,
11,
1226,
44709,
8,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1949,
25,
12001,
62,
34345,
11,
24697,
796,
2956,
297,
571,
13,
25927,
13,
6371,
1186,
30227,
7,
6371,
3672,
8,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
52,
4535,
19146,
5390,
38303,
366,
1343,
19016,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8420,
32590,
16,
8,
628,
220,
220,
220,
2393,
62,
796,
1280,
7,
12001,
62,
34345,
8,
198,
220,
220,
220,
1366,
796,
2393,
44807,
961,
3419,
198,
220,
220,
220,
220,
628,
220,
220,
220,
27711,
62,
7753,
13,
13564,
7,
7890,
8,
198,
220,
220,
220,
27711,
62,
7753,
13,
19836,
3419,
198,
220,
220,
220,
2393,
44807,
19836,
3419,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1226,
44709,
15853,
352,
198,
220,
220,
220,
220,
198,
198,
4798,
7203,
45677,
4943,
198
] | 2.442408 | 764 |
"""
Here are declare all the settings of the app.
1. Database configurations.
2. Develop config
3. Prod config
4. Also default config that is develop
"""
import os
# file' path
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
#main class configuration
# Develop configuration
# Production Configuration
# dictionary for selecting the confinguration desired
config = {
"dev": DevMode,
"prod": ProdMode,
"default": DevMode
} | [
37811,
198,
220,
220,
220,
3423,
389,
13627,
477,
262,
6460,
286,
262,
598,
13,
198,
220,
220,
220,
220,
220,
220,
220,
352,
13,
24047,
25412,
13,
198,
220,
220,
220,
220,
220,
220,
220,
362,
13,
6013,
4566,
198,
220,
220,
220,
220,
220,
220,
220,
513,
13,
1041,
67,
4566,
198,
220,
220,
220,
220,
220,
220,
220,
604,
13,
4418,
4277,
4566,
326,
318,
1205,
198,
37811,
198,
11748,
28686,
220,
198,
2,
2393,
6,
3108,
198,
33,
11159,
62,
34720,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
4008,
198,
198,
2,
12417,
1398,
8398,
198,
198,
2,
6013,
8398,
198,
198,
2,
19174,
28373,
628,
198,
2,
22155,
329,
17246,
262,
1013,
278,
3924,
10348,
198,
11250,
796,
1391,
198,
220,
220,
220,
366,
7959,
1298,
6245,
19076,
11,
198,
220,
220,
220,
366,
1676,
67,
1298,
1041,
67,
19076,
11,
628,
220,
220,
220,
366,
12286,
1298,
6245,
19076,
198,
92
] | 2.852071 | 169 |
import pytest
from django.urls import reverse
from freezegun import freeze_time
from rest_framework import status
from datahub.company_referral.test.factories import (
ClosedCompanyReferralFactory,
CompanyReferralFactory,
)
from datahub.core.test_utils import format_date_or_datetime, get_attr_or_none
from datahub.dataset.core.test import BaseDatasetViewTest
def get_expected_data_from_company_referral(referral):
"""Returns company referral data as a dictionary"""
return {
'company_id': str(referral.company_id),
'completed_by_id': get_attr_or_none(referral, 'completed_by_id'),
'completed_on': format_date_or_datetime(referral.completed_on),
'contact_id': str(referral.contact_id),
'created_by_id': str(referral.created_by_id),
'created_on': format_date_or_datetime(referral.created_on),
'id': str(referral.id),
'interaction_id': (
str(referral.interaction_id)
if referral.interaction_id is not None
else None
),
'notes': referral.notes,
'recipient_id': str(referral.recipient_id),
'status': str(referral.status),
'subject': referral.subject,
}
@pytest.mark.django_db
class TestCompanyReferralDatasetView(BaseDatasetViewTest):
"""
Tests for CompanyReferralDatasetView
"""
view_url = reverse('api-v4:dataset:company-referrals-dataset')
factory = CompanyReferralFactory
@pytest.mark.parametrize(
'referral_factory', (
CompanyReferralFactory,
ClosedCompanyReferralFactory,
),
)
def test_success(self, data_flow_api_client, referral_factory):
"""Test that endpoint returns with expected data for a single referral"""
referral = referral_factory()
response = data_flow_api_client.get(self.view_url)
assert response.status_code == status.HTTP_200_OK
response_results = response.json()['results']
assert len(response_results) == 1
result = response_results[0]
expected_result = get_expected_data_from_company_referral(referral)
assert result == expected_result
def test_with_multiple_records(self, data_flow_api_client):
"""Test that endpoint returns correct number of records"""
with freeze_time('2019-01-01 12:30:00'):
referral1 = CompanyReferralFactory()
with freeze_time('2019-01-03 12:00:00'):
referral2 = CompanyReferralFactory()
with freeze_time('2019-01-01 12:00:00'):
referral3 = CompanyReferralFactory()
referral4 = CompanyReferralFactory()
response = data_flow_api_client.get(self.view_url)
assert response.status_code == status.HTTP_200_OK
response_results = response.json()['results']
assert len(response_results) == 4
expected_list = sorted([referral3, referral4], key=lambda x: x.pk) + [referral1, referral2]
for index, referral in enumerate(expected_list):
assert str(referral.id) == response_results[index]['id']
| [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
1479,
89,
1533,
403,
1330,
16611,
62,
2435,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
198,
6738,
4818,
993,
549,
13,
39722,
62,
260,
2232,
1373,
13,
9288,
13,
22584,
1749,
1330,
357,
198,
220,
220,
220,
30550,
39154,
46238,
1373,
22810,
11,
198,
220,
220,
220,
5834,
46238,
1373,
22810,
11,
198,
8,
198,
6738,
4818,
993,
549,
13,
7295,
13,
9288,
62,
26791,
1330,
5794,
62,
4475,
62,
273,
62,
19608,
8079,
11,
651,
62,
35226,
62,
273,
62,
23108,
198,
6738,
4818,
993,
549,
13,
19608,
292,
316,
13,
7295,
13,
9288,
1330,
7308,
27354,
292,
316,
7680,
14402,
628,
198,
4299,
651,
62,
40319,
62,
7890,
62,
6738,
62,
39722,
62,
260,
2232,
1373,
7,
260,
2232,
1373,
2599,
198,
220,
220,
220,
37227,
35561,
1664,
31413,
1366,
355,
257,
22155,
37811,
198,
220,
220,
220,
1441,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
39722,
62,
312,
10354,
965,
7,
260,
2232,
1373,
13,
39722,
62,
312,
828,
198,
220,
220,
220,
220,
220,
220,
220,
705,
785,
16838,
62,
1525,
62,
312,
10354,
651,
62,
35226,
62,
273,
62,
23108,
7,
260,
2232,
1373,
11,
705,
785,
16838,
62,
1525,
62,
312,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
705,
785,
16838,
62,
261,
10354,
5794,
62,
4475,
62,
273,
62,
19608,
8079,
7,
260,
2232,
1373,
13,
785,
16838,
62,
261,
828,
198,
220,
220,
220,
220,
220,
220,
220,
705,
32057,
62,
312,
10354,
965,
7,
260,
2232,
1373,
13,
32057,
62,
312,
828,
198,
220,
220,
220,
220,
220,
220,
220,
705,
25598,
62,
1525,
62,
312,
10354,
965,
7,
260,
2232,
1373,
13,
25598,
62,
1525,
62,
312,
828,
198,
220,
220,
220,
220,
220,
220,
220,
705,
25598,
62,
261,
10354,
5794,
62,
4475,
62,
273,
62,
19608,
8079,
7,
260,
2232,
1373,
13,
25598,
62,
261,
828,
198,
220,
220,
220,
220,
220,
220,
220,
705,
312,
10354,
965,
7,
260,
2232,
1373,
13,
312,
828,
198,
220,
220,
220,
220,
220,
220,
220,
705,
3849,
2673,
62,
312,
10354,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
965,
7,
260,
2232,
1373,
13,
3849,
2673,
62,
312,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
31413,
13,
3849,
2673,
62,
312,
318,
407,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2073,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
220,
220,
220,
220,
705,
17815,
10354,
31413,
13,
17815,
11,
198,
220,
220,
220,
220,
220,
220,
220,
705,
8344,
48137,
62,
312,
10354,
965,
7,
260,
2232,
1373,
13,
8344,
48137,
62,
312,
828,
198,
220,
220,
220,
220,
220,
220,
220,
705,
13376,
10354,
965,
7,
260,
2232,
1373,
13,
13376,
828,
198,
220,
220,
220,
220,
220,
220,
220,
705,
32796,
10354,
31413,
13,
32796,
11,
198,
220,
220,
220,
1782,
628,
198,
31,
9078,
9288,
13,
4102,
13,
28241,
14208,
62,
9945,
198,
4871,
6208,
39154,
46238,
1373,
27354,
292,
316,
7680,
7,
14881,
27354,
292,
316,
7680,
14402,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
30307,
329,
5834,
46238,
1373,
27354,
292,
316,
7680,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
1570,
62,
6371,
796,
9575,
10786,
15042,
12,
85,
19,
25,
19608,
292,
316,
25,
39722,
12,
260,
2232,
30691,
12,
19608,
292,
316,
11537,
198,
220,
220,
220,
8860,
796,
5834,
46238,
1373,
22810,
628,
220,
220,
220,
2488,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
220,
220,
220,
220,
220,
220,
705,
260,
2232,
1373,
62,
69,
9548,
3256,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5834,
46238,
1373,
22810,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30550,
39154,
46238,
1373,
22810,
11,
198,
220,
220,
220,
220,
220,
220,
220,
10612,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
825,
1332,
62,
13138,
7,
944,
11,
1366,
62,
11125,
62,
15042,
62,
16366,
11,
31413,
62,
69,
9548,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
14402,
326,
36123,
5860,
351,
2938,
1366,
329,
257,
2060,
31413,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
31413,
796,
31413,
62,
69,
9548,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
1366,
62,
11125,
62,
15042,
62,
16366,
13,
1136,
7,
944,
13,
1177,
62,
6371,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2882,
13,
13376,
62,
8189,
6624,
3722,
13,
40717,
62,
2167,
62,
11380,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
43420,
796,
2882,
13,
17752,
3419,
17816,
43420,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
18896,
7,
26209,
62,
43420,
8,
6624,
352,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
2882,
62,
43420,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2938,
62,
20274,
796,
651,
62,
40319,
62,
7890,
62,
6738,
62,
39722,
62,
260,
2232,
1373,
7,
260,
2232,
1373,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
1255,
6624,
2938,
62,
20274,
628,
220,
220,
220,
825,
1332,
62,
4480,
62,
48101,
62,
8344,
3669,
7,
944,
11,
1366,
62,
11125,
62,
15042,
62,
16366,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
14402,
326,
36123,
5860,
3376,
1271,
286,
4406,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
351,
16611,
62,
2435,
10786,
23344,
12,
486,
12,
486,
1105,
25,
1270,
25,
405,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31413,
16,
796,
5834,
46238,
1373,
22810,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
351,
16611,
62,
2435,
10786,
23344,
12,
486,
12,
3070,
1105,
25,
405,
25,
405,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31413,
17,
796,
5834,
46238,
1373,
22810,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
351,
16611,
62,
2435,
10786,
23344,
12,
486,
12,
486,
1105,
25,
405,
25,
405,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31413,
18,
796,
5834,
46238,
1373,
22810,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31413,
19,
796,
5834,
46238,
1373,
22810,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
796,
1366,
62,
11125,
62,
15042,
62,
16366,
13,
1136,
7,
944,
13,
1177,
62,
6371,
8,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
2882,
13,
13376,
62,
8189,
6624,
3722,
13,
40717,
62,
2167,
62,
11380,
198,
220,
220,
220,
220,
220,
220,
220,
2882,
62,
43420,
796,
2882,
13,
17752,
3419,
17816,
43420,
20520,
198,
220,
220,
220,
220,
220,
220,
220,
6818,
18896,
7,
26209,
62,
43420,
8,
6624,
604,
198,
220,
220,
220,
220,
220,
220,
220,
2938,
62,
4868,
796,
23243,
26933,
260,
2232,
1373,
18,
11,
31413,
19,
4357,
1994,
28,
50033,
2124,
25,
2124,
13,
79,
74,
8,
1343,
685,
260,
2232,
1373,
16,
11,
31413,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
329,
6376,
11,
31413,
287,
27056,
378,
7,
40319,
62,
4868,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6818,
965,
7,
260,
2232,
1373,
13,
312,
8,
6624,
2882,
62,
43420,
58,
9630,
7131,
6,
312,
20520,
198
] | 2.444885 | 1,261 |
"""
The AwsIamTester class implements all necessary logic to run validations on an account, role or user.
"""
# pylint: disable=broad-except,C0103,E0401,R0912,R0913,R0914,R0915,R1702,W0603,W1203
from __future__ import annotations
import os
import sys
import errno
import json
import logging
import re
import time
import yaml
import click
import boto3 # type: ignore
import botocore # type: ignore
from tabulate import tabulate
from typing import Any, Dict, List, Optional, Tuple, Union #, Literal # Literal is p3.8 and higher
from termcolor import colored
| [
37811,
198,
464,
5851,
82,
40,
321,
51,
7834,
1398,
23986,
477,
3306,
9156,
284,
1057,
4938,
602,
319,
281,
1848,
11,
2597,
393,
2836,
13,
198,
37811,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
36654,
12,
16341,
11,
34,
486,
3070,
11,
36,
3023,
486,
11,
49,
2931,
1065,
11,
49,
2931,
1485,
11,
49,
2931,
1415,
11,
49,
2931,
1314,
11,
49,
1558,
2999,
11,
54,
15,
35642,
11,
54,
1065,
3070,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
11454,
3919,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
302,
198,
11748,
640,
198,
11748,
331,
43695,
198,
11748,
3904,
198,
11748,
275,
2069,
18,
1303,
2099,
25,
8856,
198,
11748,
10214,
420,
382,
1303,
2099,
25,
8856,
198,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
32233,
11,
309,
29291,
11,
4479,
220,
1303,
11,
25659,
1691,
1303,
25659,
1691,
318,
279,
18,
13,
23,
290,
2440,
198,
6738,
3381,
8043,
1330,
16396,
628
] | 3.139665 | 179 |
#!/usr/bin/python -u
import datetime
import calendar
if __name__ == "__main__":
print datetime.datetime.today().weekday() # 3
print calendar.day_name[datetime.datetime.today().weekday()]
# Thursday
| [
2,
48443,
14629,
14,
8800,
14,
29412,
532,
84,
198,
11748,
4818,
8079,
198,
11748,
11845,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
4818,
8079,
13,
19608,
8079,
13,
40838,
22446,
10464,
820,
3419,
1303,
513,
198,
220,
220,
220,
3601,
11845,
13,
820,
62,
3672,
58,
19608,
8079,
13,
19608,
8079,
13,
40838,
22446,
10464,
820,
3419,
60,
198,
220,
220,
220,
1303,
3635,
198
] | 2.776316 | 76 |
from rich.console import Console
import subprocess as sp
import time
import click
@click.command()
@click.option('--path','-p',help='Path of file to watch')
@click.option('--arguments','-args',help='Arguments to run when file changes')
@click.option('--delay','-d',default=4,help='Delay in seconds')
def start(path,arguments,delay):
'''FILEWATCH is a file watcher that allows you to watch files if something changes run arguments'''
App(filepath=str(path),arguments=arguments,delay=delay)
if __name__ == '__main__':
try:
start()
except FileNotFoundError:
print("Use --help to see help information") | [
6738,
5527,
13,
41947,
1330,
24371,
201,
198,
11748,
850,
14681,
355,
599,
201,
198,
11748,
640,
201,
198,
11748,
3904,
201,
198,
201,
198,
201,
198,
31,
12976,
13,
21812,
3419,
201,
198,
31,
12976,
13,
18076,
10786,
438,
6978,
3256,
29001,
79,
3256,
16794,
11639,
15235,
286,
2393,
284,
2342,
11537,
201,
198,
31,
12976,
13,
18076,
10786,
438,
853,
2886,
3256,
29001,
22046,
3256,
16794,
11639,
28100,
2886,
284,
1057,
618,
2393,
2458,
11537,
201,
198,
31,
12976,
13,
18076,
10786,
438,
40850,
3256,
29001,
67,
3256,
12286,
28,
19,
11,
16794,
11639,
13856,
323,
287,
4201,
11537,
201,
198,
4299,
923,
7,
6978,
11,
853,
2886,
11,
40850,
2599,
201,
198,
220,
220,
220,
705,
7061,
25664,
35192,
318,
257,
2393,
4383,
2044,
326,
3578,
345,
284,
2342,
3696,
611,
1223,
2458,
1057,
7159,
7061,
6,
201,
198,
220,
220,
220,
2034,
7,
7753,
6978,
28,
2536,
7,
6978,
828,
853,
2886,
28,
853,
2886,
11,
40850,
28,
40850,
8,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
1949,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
923,
3419,
201,
198,
201,
198,
220,
220,
220,
2845,
9220,
3673,
21077,
12331,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
11041,
1377,
16794,
284,
766,
1037,
1321,
4943
] | 2.864035 | 228 |
import json
import os
from lib.object_documentor import (
documentize_object,
documentize_prop,
documentize_array,
)
file_name = input("Specify json to document: ")
file = open(file_name)
data = json.load(file)
# Iterating through the json
lines = [" Prop | Type | Description | Example \n", "----|----|----|----\n"]
for i in data:
parents = (i,)
if isinstance(data[i], dict):
lines = lines + documentize_object(i, data[i], parents)
elif isinstance(data[i], list):
lines = lines + documentize_array(i, data[i], parents)
else:
lines = lines + documentize_prop(i, data[i])
file.close()
# Write output MD to file
directory = "./output-md"
if not os.path.exists(directory):
os.makedirs(directory)
file1 = open(directory + "/" + file_name + ".md", "w+")
file1.writelines(lines)
file1.close()
| [
11748,
33918,
198,
11748,
28686,
198,
6738,
9195,
13,
15252,
62,
22897,
273,
1330,
357,
198,
220,
220,
220,
3188,
1096,
62,
15252,
11,
198,
220,
220,
220,
3188,
1096,
62,
22930,
11,
198,
220,
220,
220,
3188,
1096,
62,
18747,
11,
198,
8,
198,
198,
7753,
62,
3672,
796,
5128,
7203,
22882,
1958,
33918,
284,
3188,
25,
366,
8,
198,
198,
7753,
796,
1280,
7,
7753,
62,
3672,
8,
198,
198,
7890,
796,
33918,
13,
2220,
7,
7753,
8,
198,
198,
2,
40806,
803,
832,
262,
33918,
198,
6615,
796,
14631,
8772,
930,
5994,
930,
12489,
930,
17934,
3467,
77,
1600,
366,
650,
91,
650,
91,
650,
91,
650,
59,
77,
8973,
198,
1640,
1312,
287,
1366,
25,
198,
220,
220,
220,
3397,
796,
357,
72,
35751,
198,
220,
220,
220,
611,
318,
39098,
7,
7890,
58,
72,
4357,
8633,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3951,
796,
3951,
1343,
3188,
1096,
62,
15252,
7,
72,
11,
1366,
58,
72,
4357,
3397,
8,
198,
220,
220,
220,
1288,
361,
318,
39098,
7,
7890,
58,
72,
4357,
1351,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3951,
796,
3951,
1343,
3188,
1096,
62,
18747,
7,
72,
11,
1366,
58,
72,
4357,
3397,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3951,
796,
3951,
1343,
3188,
1096,
62,
22930,
7,
72,
11,
1366,
58,
72,
12962,
198,
7753,
13,
19836,
3419,
198,
198,
2,
19430,
5072,
10670,
284,
2393,
198,
34945,
796,
366,
19571,
22915,
12,
9132,
1,
198,
198,
361,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
34945,
2599,
198,
220,
220,
220,
28686,
13,
76,
4335,
17062,
7,
34945,
8,
198,
7753,
16,
796,
1280,
7,
34945,
1343,
12813,
1,
1343,
2393,
62,
3672,
1343,
27071,
9132,
1600,
366,
86,
10,
4943,
198,
7753,
16,
13,
8933,
20655,
7,
6615,
8,
198,
7753,
16,
13,
19836,
3419,
198
] | 2.64486 | 321 |
# Blackheart Day Damage Skin
success = sm.addDamageSkin(2435313)
if success:
sm.chat("The Blackheart Day Damage Skin has been added to your account's damage skin collection.")
# sm.consumeItem(2435313)
| [
2,
2619,
11499,
3596,
8995,
17847,
198,
13138,
796,
895,
13,
2860,
22022,
42455,
7,
1731,
2327,
25838,
8,
198,
361,
1943,
25,
198,
220,
220,
220,
895,
13,
17006,
7203,
464,
2619,
11499,
3596,
8995,
17847,
468,
587,
2087,
284,
534,
1848,
338,
2465,
4168,
4947,
19570,
198,
220,
220,
220,
1303,
895,
13,
5936,
2454,
7449,
7,
1731,
2327,
25838,
8,
198
] | 3.28125 | 64 |
import numpy as np
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Layer
class ScheduledDropout(Layer):
"""Applies Scheduled Dropout to the input.
The Dropout layer randomly sets input units to 0 with a frequency of `rate`
scheduled by network layer's depth and training step at each step, which
helps prevent overfitting.
Inputs not set to 0 are scaled up by 1/(1 - rate) such that the sum over
all inputs is unchanged.
Note that the Dropout layer only applies when `training` is set to True
such that no values are dropped during inference. When using `model.fit`,
`training` will be appropriately set to True automatically, and in other
contexts, you can set the kwarg explicitly to True when calling the layer.
(This is in contrast to setting `trainable=False` for a Dropout layer.
`trainable` does not affect the layer's behavior, as Dropout does
not have any variables/weights that can be frozen during training.)
Arguments:
drop_rate: Float between 0 and 1. Fraction of the input units to drop.
cell_num: Cell number in the network
total_num_cells: Number of cells in the network
total_training_steps: Number of total steps performed during training
seed: A Python integer to use as random seed.
Call arguments:
inputs: Input tensor (of any rank).
training: Python boolean indicating whether the layer should behave in
training mode (adding dropout) or in inference mode (doing nothing).
"""
class ScheduledDroppath(Layer):
"""Applies Scheduled Droppath to the input.
The Droppath layer randomly sets whole input path inside to 0 with a
frequency of `rate` scheduled by network layer's depth and training
step at each step, which helps prevent overfitting.
Inputs not set to 0 are scaled up by 1/(1 - rate) such that the sum over
all inputs is unchanged.
Note that the Scheduled Droppath layer only applies when `training` is set to True.
When using `model.fit`, `training` will be appropriately set to True
automatically, and in other contexts, you can set the kwarg explicitly
to True when calling the layer. (This is in contrast to setting
`trainable=False` for a Droppath layer. `trainable` does not affect the
layer's behavior, as Droppath does not have any variables/weights that
can be frozen during training.)
Arguments:
drop_rate: Float between 0 and 1. Fraction of the inputs to drop.
cell_num: Cell number in the network
total_num_cells: Number of cells in the network
total_training_steps: Number of total steps performed during training
seed: A Python integer to use as random seed.
Call arguments:
inputs: Input tensor (of any rank).
training: Python boolean indicating whether the layer should behave in
training mode (adding dropout) or in inference mode (doing nothing).
"""
class ConcreteDropout(Layer):
"""Applies Concrete Dropout to the input.
The Concrete Droppath layer randomly sets input path to 0 with a
frequency considered as a weight of the layer optimized during training
time, which helps prevent overfitting.
Inputs not set to 0 are scaled up by 1/(1 - rate) such that the sum over
all inputs is unchanged.
Note that the Concrete Dropout layer only applies when `training` is set
to True. When using `model.fit`, `training` will be appropriately set to
True automatically, and in other contexts, you can set the kwarg explicitly
to True when calling the layer. (This is in contrast to setting
`trainable=False` for a Concrete Dropout layer. `trainable` does not affect
the layer's behavior, as Dropout does not have any variables/weights that
can be frozen during training.)
Arguments:
dropout_regularizer: A positive number which satisfies
$dropout_regularizer = 2 / (\tau * N)$ with model precision
$\tau$ (inverse observation noise) and N the number of
instances in the dataset.
init_min: dropout probability initializer min
init_max: dropout probability initializer max
seed: A Python integer to use as random seed.
Call arguments:
inputs: Input tensor (of any rank).
training: Python boolean indicating whether the layer should behave in
training mode (adding dropout) or in inference mode (doing nothing).
"""
@tf.function
def concrete_dropout(self, x):
'''
Concrete dropout - used at training time and testing time (gradients can be propagated)
:param x: input
:return: approx. dropped out input
'''
eps = K.cast_to_floatx(K.epsilon())
temp = 0.1
unif_noise = K.random_uniform(K.shape(x))
drop_prob = (
K.log(self.get_p() + eps)
- K.log(1. - self.get_p() + eps)
+ K.log(unif_noise + eps)
- K.log(1. - unif_noise + eps)
)
drop_prob = K.sigmoid(drop_prob / temp)
random_tensor = 1. - drop_prob
retain_prob = 1. - self.get_p()
x *= random_tensor
x /= retain_prob
return x
class ConcreteDroppath(Layer):
"""Applies Concrete Droppath to the input.
The Concrete Droppath layer randomly sets input path to 0 with a
frequency considered as a weight of the layer optimized during training
time, which helps prevent overfitting.
Inputs not set to 0 are scaled up by 1/(1 - rate) such that the sum over
all inputs is unchanged.
Note that the Concrete Droppath layer only applies when `training` is set
to True. When using `model.fit`, `training` will be appropriately set to
True automatically, and in other contexts, you can set the kwarg explicitly
to True when calling the layer. (This is in contrast to setting
`trainable=False` for a Concrete Droppath layer. `trainable` does not affect
the layer's behavior, as Dropout does not have any variables/weights that
can be frozen during training.)
Arguments:
dropout_regularizer: A positive number which satisfies
$dropout_regularizer = 2 / (\tau * N)$ with model precision
$\tau$ (inverse observation noise) and N the number of
instances in the dataset.
init_min: dropout probability initializer min
init_max: dropout probability initializer max
seed: A Python integer to use as random seed.
Call arguments:
inputs: Input tensor (of any rank).
training: Python boolean indicating whether the layer should behave in
training mode (adding dropout) or in inference mode (doing nothing).
"""
@tf.function
def concrete_droppath(self, x):
"""
Concrete droppath - used at training and testing time (gradients can be propagated)
:param x: input
:return: approx. dropped out input
"""
eps = K.cast_to_floatx(K.epsilon())
temp = 0.1
unif_noise = tf.random.uniform(shape=[K.shape(x)[0], 1, 1, 1])
drop_prob = (
K.log(self.get_p() + eps)
- K.log(1. - self.get_p() + eps)
+ K.log(unif_noise + eps)
- K.log(1. - unif_noise + eps)
)
drop_prob = K.sigmoid(drop_prob / temp)
random_tensor = 1. - drop_prob
retain_prob = 1. - self.get_p()
x *= random_tensor
x /= retain_prob
return x
| [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
1330,
30203,
355,
509,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
34398,
628,
198,
4871,
27774,
6309,
26932,
448,
7,
49925,
2599,
198,
220,
220,
220,
37227,
4677,
13508,
27774,
6309,
14258,
448,
284,
262,
5128,
13,
198,
220,
220,
220,
220,
220,
220,
220,
383,
14258,
448,
7679,
15456,
5621,
5128,
4991,
284,
657,
351,
257,
8373,
286,
4600,
4873,
63,
198,
220,
220,
220,
220,
220,
220,
220,
7530,
416,
3127,
7679,
338,
6795,
290,
3047,
2239,
379,
1123,
2239,
11,
543,
198,
220,
220,
220,
220,
220,
220,
220,
5419,
2948,
625,
32232,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23412,
82,
407,
900,
284,
657,
389,
27464,
510,
416,
352,
29006,
16,
532,
2494,
8,
884,
326,
262,
2160,
625,
198,
220,
220,
220,
220,
220,
220,
220,
477,
17311,
318,
21588,
13,
198,
220,
220,
220,
220,
220,
220,
220,
5740,
326,
262,
14258,
448,
7679,
691,
8991,
618,
4600,
34409,
63,
318,
900,
284,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
884,
326,
645,
3815,
389,
5710,
1141,
32278,
13,
1649,
1262,
4600,
19849,
13,
11147,
47671,
198,
220,
220,
220,
220,
220,
220,
220,
4600,
34409,
63,
481,
307,
20431,
900,
284,
6407,
6338,
11,
290,
287,
584,
198,
220,
220,
220,
220,
220,
220,
220,
26307,
11,
345,
460,
900,
262,
479,
86,
853,
11777,
284,
6407,
618,
4585,
262,
7679,
13,
198,
220,
220,
220,
220,
220,
220,
220,
357,
1212,
318,
287,
6273,
284,
4634,
4600,
27432,
540,
28,
25101,
63,
329,
257,
14258,
448,
7679,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4600,
27432,
540,
63,
857,
407,
2689,
262,
7679,
338,
4069,
11,
355,
14258,
448,
857,
198,
220,
220,
220,
220,
220,
220,
220,
407,
423,
597,
9633,
14,
43775,
326,
460,
307,
12912,
1141,
3047,
2014,
198,
220,
220,
220,
220,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4268,
62,
4873,
25,
48436,
1022,
657,
290,
352,
13,
376,
7861,
286,
262,
5128,
4991,
284,
4268,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2685,
62,
22510,
25,
12440,
1271,
287,
262,
3127,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
22510,
62,
46342,
25,
7913,
286,
4778,
287,
262,
3127,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
34409,
62,
20214,
25,
7913,
286,
2472,
4831,
6157,
1141,
3047,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9403,
25,
317,
11361,
18253,
284,
779,
355,
4738,
9403,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4889,
7159,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17311,
25,
23412,
11192,
273,
357,
1659,
597,
4279,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
25,
11361,
25131,
12739,
1771,
262,
7679,
815,
17438,
287,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
4235,
357,
26872,
4268,
448,
8,
393,
287,
32278,
4235,
357,
19631,
2147,
737,
198,
220,
220,
220,
37227,
628,
198,
4871,
27774,
6309,
35442,
381,
776,
7,
49925,
2599,
198,
220,
220,
220,
37227,
4677,
13508,
27774,
6309,
21045,
381,
776,
284,
262,
5128,
13,
198,
220,
220,
220,
220,
220,
220,
220,
383,
21045,
381,
776,
7679,
15456,
5621,
2187,
5128,
3108,
2641,
284,
657,
351,
257,
198,
220,
220,
220,
220,
220,
220,
220,
8373,
286,
4600,
4873,
63,
7530,
416,
3127,
7679,
338,
6795,
290,
3047,
198,
220,
220,
220,
220,
220,
220,
220,
2239,
379,
1123,
2239,
11,
543,
5419,
2948,
625,
32232,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23412,
82,
407,
900,
284,
657,
389,
27464,
510,
416,
352,
29006,
16,
532,
2494,
8,
884,
326,
262,
2160,
625,
198,
220,
220,
220,
220,
220,
220,
220,
477,
17311,
318,
21588,
13,
198,
220,
220,
220,
220,
220,
220,
220,
5740,
326,
262,
27774,
6309,
21045,
381,
776,
7679,
691,
8991,
618,
4600,
34409,
63,
318,
900,
284,
6407,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1649,
1262,
4600,
19849,
13,
11147,
47671,
4600,
34409,
63,
481,
307,
20431,
900,
284,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
6338,
11,
290,
287,
584,
26307,
11,
345,
460,
900,
262,
479,
86,
853,
11777,
198,
220,
220,
220,
220,
220,
220,
220,
284,
6407,
618,
4585,
262,
7679,
13,
357,
1212,
318,
287,
6273,
284,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
4600,
27432,
540,
28,
25101,
63,
329,
257,
21045,
381,
776,
7679,
13,
4600,
27432,
540,
63,
857,
407,
2689,
262,
198,
220,
220,
220,
220,
220,
220,
220,
7679,
338,
4069,
11,
355,
21045,
381,
776,
857,
407,
423,
597,
9633,
14,
43775,
326,
198,
220,
220,
220,
220,
220,
220,
220,
460,
307,
12912,
1141,
3047,
2014,
198,
220,
220,
220,
220,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4268,
62,
4873,
25,
48436,
1022,
657,
290,
352,
13,
376,
7861,
286,
262,
17311,
284,
4268,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2685,
62,
22510,
25,
12440,
1271,
287,
262,
3127,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
22510,
62,
46342,
25,
7913,
286,
4778,
287,
262,
3127,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
34409,
62,
20214,
25,
7913,
286,
2472,
4831,
6157,
1141,
3047,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9403,
25,
317,
11361,
18253,
284,
779,
355,
4738,
9403,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4889,
7159,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17311,
25,
23412,
11192,
273,
357,
1659,
597,
4279,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
25,
11361,
25131,
12739,
1771,
262,
7679,
815,
17438,
287,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
4235,
357,
26872,
4268,
448,
8,
393,
287,
32278,
4235,
357,
19631,
2147,
737,
198,
220,
220,
220,
37227,
628,
198,
4871,
1482,
38669,
26932,
448,
7,
49925,
2599,
198,
220,
220,
220,
37227,
4677,
13508,
1482,
38669,
14258,
448,
284,
262,
5128,
13,
198,
220,
220,
220,
220,
220,
220,
220,
383,
1482,
38669,
21045,
381,
776,
7679,
15456,
5621,
5128,
3108,
284,
657,
351,
257,
198,
220,
220,
220,
220,
220,
220,
220,
8373,
3177,
355,
257,
3463,
286,
262,
7679,
23392,
1141,
3047,
198,
220,
220,
220,
220,
220,
220,
220,
640,
11,
543,
5419,
2948,
625,
32232,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23412,
82,
407,
900,
284,
657,
389,
27464,
510,
416,
352,
29006,
16,
532,
2494,
8,
884,
326,
262,
2160,
625,
198,
220,
220,
220,
220,
220,
220,
220,
477,
17311,
318,
21588,
13,
198,
220,
220,
220,
220,
220,
220,
220,
5740,
326,
262,
1482,
38669,
14258,
448,
7679,
691,
8991,
618,
4600,
34409,
63,
318,
900,
198,
220,
220,
220,
220,
220,
220,
220,
284,
6407,
13,
1649,
1262,
4600,
19849,
13,
11147,
47671,
4600,
34409,
63,
481,
307,
20431,
900,
284,
198,
220,
220,
220,
220,
220,
220,
220,
6407,
6338,
11,
290,
287,
584,
26307,
11,
345,
460,
900,
262,
479,
86,
853,
11777,
198,
220,
220,
220,
220,
220,
220,
220,
284,
6407,
618,
4585,
262,
7679,
13,
357,
1212,
318,
287,
6273,
284,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
4600,
27432,
540,
28,
25101,
63,
329,
257,
1482,
38669,
14258,
448,
7679,
13,
4600,
27432,
540,
63,
857,
407,
2689,
198,
220,
220,
220,
220,
220,
220,
220,
262,
7679,
338,
4069,
11,
355,
14258,
448,
857,
407,
423,
597,
9633,
14,
43775,
326,
198,
220,
220,
220,
220,
220,
220,
220,
460,
307,
12912,
1141,
3047,
2014,
198,
220,
220,
220,
220,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4268,
448,
62,
16338,
7509,
25,
317,
3967,
1271,
543,
45104,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
14781,
448,
62,
16338,
7509,
796,
362,
1220,
357,
59,
83,
559,
1635,
399,
8,
3,
351,
2746,
15440,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39280,
83,
559,
3,
357,
259,
4399,
13432,
7838,
8,
290,
399,
262,
1271,
286,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10245,
287,
262,
27039,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2315,
62,
1084,
25,
4268,
448,
12867,
4238,
7509,
949,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2315,
62,
9806,
25,
4268,
448,
12867,
4238,
7509,
3509,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9403,
25,
317,
11361,
18253,
284,
779,
355,
4738,
9403,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4889,
7159,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17311,
25,
23412,
11192,
273,
357,
1659,
597,
4279,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
25,
11361,
25131,
12739,
1771,
262,
7679,
815,
17438,
287,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
4235,
357,
26872,
4268,
448,
8,
393,
287,
32278,
4235,
357,
19631,
2147,
737,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
27110,
13,
8818,
628,
220,
220,
220,
825,
10017,
62,
14781,
448,
7,
944,
11,
2124,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1482,
38669,
4268,
448,
532,
973,
379,
3047,
640,
290,
4856,
640,
357,
9744,
2334,
460,
307,
8928,
515,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
2124,
25,
5128,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
220,
5561,
13,
5710,
503,
5128,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
220,
220,
220,
220,
304,
862,
796,
509,
13,
2701,
62,
1462,
62,
22468,
87,
7,
42,
13,
538,
18217,
261,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
20218,
796,
657,
13,
16,
198,
220,
220,
220,
220,
220,
220,
220,
555,
361,
62,
3919,
786,
796,
509,
13,
25120,
62,
403,
6933,
7,
42,
13,
43358,
7,
87,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
4268,
62,
1676,
65,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
509,
13,
6404,
7,
944,
13,
1136,
62,
79,
3419,
1343,
304,
862,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
509,
13,
6404,
7,
16,
13,
532,
2116,
13,
1136,
62,
79,
3419,
1343,
304,
862,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1343,
509,
13,
6404,
7,
403,
361,
62,
3919,
786,
1343,
304,
862,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
509,
13,
6404,
7,
16,
13,
532,
555,
361,
62,
3919,
786,
1343,
304,
862,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
4268,
62,
1676,
65,
796,
509,
13,
82,
17225,
1868,
7,
14781,
62,
1676,
65,
1220,
20218,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4738,
62,
83,
22854,
796,
352,
13,
532,
4268,
62,
1676,
65,
198,
220,
220,
220,
220,
220,
220,
220,
12377,
62,
1676,
65,
796,
352,
13,
532,
2116,
13,
1136,
62,
79,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
1635,
28,
4738,
62,
83,
22854,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
1220,
28,
12377,
62,
1676,
65,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2124,
628,
198,
4871,
1482,
38669,
35442,
381,
776,
7,
49925,
2599,
198,
220,
220,
220,
37227,
4677,
13508,
1482,
38669,
21045,
381,
776,
284,
262,
5128,
13,
198,
220,
220,
220,
220,
220,
220,
220,
383,
1482,
38669,
21045,
381,
776,
7679,
15456,
5621,
5128,
3108,
284,
657,
351,
257,
198,
220,
220,
220,
220,
220,
220,
220,
8373,
3177,
355,
257,
3463,
286,
262,
7679,
23392,
1141,
3047,
198,
220,
220,
220,
220,
220,
220,
220,
640,
11,
543,
5419,
2948,
625,
32232,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23412,
82,
407,
900,
284,
657,
389,
27464,
510,
416,
352,
29006,
16,
532,
2494,
8,
884,
326,
262,
2160,
625,
198,
220,
220,
220,
220,
220,
220,
220,
477,
17311,
318,
21588,
13,
198,
220,
220,
220,
220,
220,
220,
220,
5740,
326,
262,
1482,
38669,
21045,
381,
776,
7679,
691,
8991,
618,
4600,
34409,
63,
318,
900,
198,
220,
220,
220,
220,
220,
220,
220,
284,
6407,
13,
1649,
1262,
4600,
19849,
13,
11147,
47671,
4600,
34409,
63,
481,
307,
20431,
900,
284,
198,
220,
220,
220,
220,
220,
220,
220,
6407,
6338,
11,
290,
287,
584,
26307,
11,
345,
460,
900,
262,
479,
86,
853,
11777,
198,
220,
220,
220,
220,
220,
220,
220,
284,
6407,
618,
4585,
262,
7679,
13,
357,
1212,
318,
287,
6273,
284,
4634,
198,
220,
220,
220,
220,
220,
220,
220,
4600,
27432,
540,
28,
25101,
63,
329,
257,
1482,
38669,
21045,
381,
776,
7679,
13,
4600,
27432,
540,
63,
857,
407,
2689,
198,
220,
220,
220,
220,
220,
220,
220,
262,
7679,
338,
4069,
11,
355,
14258,
448,
857,
407,
423,
597,
9633,
14,
43775,
326,
198,
220,
220,
220,
220,
220,
220,
220,
460,
307,
12912,
1141,
3047,
2014,
198,
220,
220,
220,
220,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4268,
448,
62,
16338,
7509,
25,
317,
3967,
1271,
543,
45104,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
720,
14781,
448,
62,
16338,
7509,
796,
362,
1220,
357,
59,
83,
559,
1635,
399,
8,
3,
351,
2746,
15440,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39280,
83,
559,
3,
357,
259,
4399,
13432,
7838,
8,
290,
399,
262,
1271,
286,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10245,
287,
262,
27039,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2315,
62,
1084,
25,
4268,
448,
12867,
4238,
7509,
949,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2315,
62,
9806,
25,
4268,
448,
12867,
4238,
7509,
3509,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9403,
25,
317,
11361,
18253,
284,
779,
355,
4738,
9403,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4889,
7159,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17311,
25,
23412,
11192,
273,
357,
1659,
597,
4279,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
25,
11361,
25131,
12739,
1771,
262,
7679,
815,
17438,
287,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
4235,
357,
26872,
4268,
448,
8,
393,
287,
32278,
4235,
357,
19631,
2147,
737,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
27110,
13,
8818,
628,
220,
220,
220,
825,
10017,
62,
22285,
381,
776,
7,
944,
11,
2124,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1482,
38669,
3102,
381,
776,
532,
973,
379,
3047,
290,
4856,
640,
357,
9744,
2334,
460,
307,
8928,
515,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
2124,
25,
5128,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
220,
5561,
13,
5710,
503,
5128,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
220,
220,
220,
220,
304,
862,
796,
509,
13,
2701,
62,
1462,
62,
22468,
87,
7,
42,
13,
538,
18217,
261,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
20218,
796,
657,
13,
16,
198,
220,
220,
220,
220,
220,
220,
220,
555,
361,
62,
3919,
786,
796,
48700,
13,
25120,
13,
403,
6933,
7,
43358,
41888,
42,
13,
43358,
7,
87,
38381,
15,
4357,
352,
11,
352,
11,
352,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
4268,
62,
1676,
65,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
509,
13,
6404,
7,
944,
13,
1136,
62,
79,
3419,
1343,
304,
862,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
509,
13,
6404,
7,
16,
13,
532,
2116,
13,
1136,
62,
79,
3419,
1343,
304,
862,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1343,
509,
13,
6404,
7,
403,
361,
62,
3919,
786,
1343,
304,
862,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
532,
509,
13,
6404,
7,
16,
13,
532,
555,
361,
62,
3919,
786,
1343,
304,
862,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
4268,
62,
1676,
65,
796,
509,
13,
82,
17225,
1868,
7,
14781,
62,
1676,
65,
1220,
20218,
8,
198,
220,
220,
220,
220,
220,
220,
220,
4738,
62,
83,
22854,
796,
352,
13,
532,
4268,
62,
1676,
65,
198,
220,
220,
220,
220,
220,
220,
220,
12377,
62,
1676,
65,
796,
352,
13,
532,
2116,
13,
1136,
62,
79,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
1635,
28,
4738,
62,
83,
22854,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
1220,
28,
12377,
62,
1676,
65,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2124,
198
] | 2.604788 | 3,049 |
import re
string = ""
while True:
command = input()
if command == "":
break
else:
string += " "+command
search_patter = r"(www\.([A-Za-z0-9]+((-[A-Za-z0-9]+))*)\.([a-z]+((\.[a-z]+))*))"
for i in re.findall(search_patter, string):
print(i[0]) | [
11748,
302,
198,
198,
8841,
796,
13538,
198,
4514,
6407,
25,
198,
220,
220,
220,
3141,
796,
5128,
3419,
198,
220,
220,
220,
611,
3141,
6624,
366,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4731,
15853,
366,
43825,
21812,
198,
12947,
62,
79,
1436,
796,
374,
18109,
2503,
59,
12195,
58,
32,
12,
57,
64,
12,
89,
15,
12,
24,
48688,
19510,
49146,
32,
12,
57,
64,
12,
89,
15,
12,
24,
48688,
4008,
9,
19415,
12195,
58,
64,
12,
89,
48688,
19510,
59,
3693,
64,
12,
89,
48688,
4008,
9,
4008,
1,
198,
1640,
1312,
287,
302,
13,
19796,
439,
7,
12947,
62,
79,
1436,
11,
4731,
2599,
198,
220,
220,
220,
3601,
7,
72,
58,
15,
12962
] | 2.014706 | 136 |
"""
Do not modify this file. It is generated from the Swagger specification.
Container module for JSONSchema definitions.
This does not include inlined definitions.
The pretty-printing functionality provided by the json module is superior to
what is provided by pformat, hence the use of json.loads().
"""
import json
# When no schema is provided in the definition, we use an empty schema
__UNSPECIFIED__ = {}
{% for name, definition in schemas|dictsort(true) %}
{{ name }} = json.loads("""
{{ definition }}
""",strict=False)
{% endfor %}
| [
37811,
198,
5211,
407,
13096,
428,
2393,
13,
632,
318,
7560,
422,
262,
2451,
7928,
20855,
13,
198,
198,
29869,
8265,
329,
19449,
27054,
2611,
17336,
13,
198,
1212,
857,
407,
2291,
287,
10837,
17336,
13,
198,
198,
464,
2495,
12,
4798,
278,
11244,
2810,
416,
262,
33918,
8265,
318,
9098,
284,
198,
10919,
318,
2810,
416,
279,
18982,
11,
12891,
262,
779,
286,
33918,
13,
46030,
22446,
198,
37811,
198,
11748,
33918,
198,
198,
2,
1649,
645,
32815,
318,
2810,
287,
262,
6770,
11,
356,
779,
281,
6565,
32815,
198,
834,
4944,
48451,
28343,
834,
796,
23884,
198,
198,
90,
4,
329,
1438,
11,
6770,
287,
3897,
5356,
91,
11600,
30619,
7,
7942,
8,
4064,
92,
198,
27007,
1438,
34949,
796,
33918,
13,
46030,
7203,
15931,
198,
27007,
6770,
34949,
198,
15931,
1600,
301,
2012,
28,
25101,
8,
198,
198,
90,
4,
886,
1640,
4064,
92,
198
] | 3.675676 | 148 |
# VMware vCloud Director Python SDK
# Copyright (c) 2014-2019 VMware, 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.
import click
from pyvcloud.vcd.vapp_firewall import VappFirewall
from vcd_cli.utils import restore_session
from vcd_cli.utils import stderr
from vcd_cli.utils import stdout
from vcd_cli.vapp_network import services
@services.group('firewall',
short_help='manage firewall service of vapp network')
@click.pass_context
def firewall(ctx):
"""Manages firewall service of vapp network.
\b
Examples
vcd vapp network services firewall enable-firewall vapp_name
network_name --enable
Enable firewall service.
\b
vcd vapp network services firewall set-default-action vapp_name
network_name --action allow --log-action False
Set deault action in firewall service.
\b
vcd vapp network services firewall list vapp_name network_name
List firewall rules in firewall service.
\b
vcd vapp network services firewall add vapp_name network_name rule_name
--enable --policy drop --protocols Tcp,Udp --source-ip Any
--source-port-range Any --destination-port-range Any
--destination-ip Any --enable-logging
Add firewall rule in firewall service.
\b
vcd vapp network services firewall update vapp_name network_name
rule_name --name rule_new_name --enable --policy
drop --protocols Tcp,Udp --source-ip Any
--source-port-range Any --destination-port-range Any
--destination-ip Any --enable-logging
Update firewall rule in firewall service.
\b
vcd vapp network services firewall delete vapp_name network_name
--name firewall_rule_name
Delete firewall rule in firewall service.
"""
def get_vapp_network_firewall(ctx, vapp_name, network_name):
"""Get the VappFirewall object.
It will restore sessions if expired. It will reads the client and
creates the VappFirewall object.
"""
restore_session(ctx, vdc_required=True)
client = ctx.obj['client']
vapp_dhcp = VappFirewall(client, vapp_name, network_name)
return vapp_dhcp
@firewall.command('enable-firewall', short_help='Enable firewall service')
@click.pass_context
@click.argument('vapp_name', metavar='<vapp-name>', required=True)
@click.argument('network_name', metavar='<network-name>', required=True)
@click.option('--enable/--disable',
'is_enabled',
default=True,
metavar='<is_enable>',
help='enable firewall service')
@firewall.command('set-default-action',
short_help='set default action of firewall service')
@click.pass_context
@click.argument('vapp_name', metavar='<vapp-name>', required=True)
@click.argument('network_name', metavar='<network-name>', required=True)
@click.option('--action',
'action',
default='drop',
metavar='<action>',
help='deafult action on firewall service')
@click.option('--enable-log-action/--disable-log-action',
'log_action',
default=True,
metavar='<log_action>',
help='default action on firewall service log')
@firewall.command('add', short_help='add firewall rule to firewall service')
@click.pass_context
@click.argument('vapp_name', metavar='<vapp-name>', required=True)
@click.argument('network_name', metavar='<network-name>', required=True)
@click.argument('firewall_rule_name',
metavar='<firewall-rule-name>',
required=True)
@click.option('--enable/--disable',
'is_enable',
default=True,
metavar='<is_enable>',
help='enable firewall rule')
@click.option('--policy',
'policy',
default='drop',
metavar='<policy>',
help='policy on firewall rule')
@click.option('--protocols',
'protocols',
default=None,
metavar='<protocols>',
help='all protocol names in comma separated format')
@click.option('--source-port-range',
'source_port_range',
default='Any',
metavar='<source_port_range>',
help='source port range on firewall rule')
@click.option('--source-ip',
'source_ip',
default='Any',
metavar='<source_ip>',
help='source ip on firewall rule')
@click.option('--destination-port-range',
'destination_port_range',
default='Any',
metavar='<destination_port_range>',
help='destination port range on firewall rule')
@click.option('--destination-ip',
'destination_ip',
default='Any',
metavar='<destination_ip>',
help='destination ip on firewall rule')
@click.option('--enable-logging/--disable-logging',
'is_logging',
default=True,
metavar='<is_logging>',
help='enable logging on firewall rule')
@firewall.command('list', short_help='list firewall rules in firewall service')
@click.pass_context
@click.argument('vapp_name', metavar='<vapp-name>', required=True)
@click.argument('network_name', metavar='<network-name>', required=True)
@firewall.command('update',
short_help='update firewall rule of firewall service')
@click.pass_context
@click.argument('vapp_name', metavar='<vapp-name>', required=True)
@click.argument('network_name', metavar='<network-name>', required=True)
@click.argument('firewall_rule_name',
metavar='<firewall-rule-name>',
required=True)
@click.option('--name',
'new_name',
default=None,
metavar='<new_name>',
help='new name of firewall rule')
@click.option('--enable/--disable',
'is_enable',
default=None,
metavar='<is_enable>',
help='enable firewall rule')
@click.option('--policy',
'policy',
default=None,
metavar='<policy>',
help='policy on firewall rule')
@click.option('--protocols',
'protocols',
default=None,
metavar='<protocols>',
help='all protocol names in comma separated format')
@click.option('--source-port-range',
'source_port_range',
default=None,
metavar='<source_port_range>',
help='source port range on firewall rule')
@click.option('--source-ip',
'source_ip',
default=None,
metavar='<source_ip>',
help='source ip on firewall rule')
@click.option('--destination-port-range',
'destination_port_range',
default=None,
metavar='<destination_port_range>',
help='destination port range on firewall rule')
@click.option('--destination-ip',
'destination_ip',
default=None,
metavar='<destination_ip>',
help='destination ip on firewall rule')
@click.option('--enable-logging/--disable-logging',
'is_logging',
default=None,
metavar='<is_logging>',
help='enable logging on firewall rule')
@firewall.command('delete',
short_help='delete firewall rule in firewall service')
@click.pass_context
@click.argument('vapp_name', metavar='<vapp-name>', required=True)
@click.argument('network_name', metavar='<network-name>', required=True)
@click.argument('firewall_rule_name',
metavar='<firewall-rule-name>',
required=True)
| [
2,
37754,
410,
18839,
5890,
11361,
26144,
198,
2,
15069,
357,
66,
8,
1946,
12,
23344,
37754,
11,
3457,
13,
1439,
6923,
33876,
13,
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,
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,
11748,
3904,
198,
6738,
12972,
85,
17721,
13,
85,
10210,
13,
85,
1324,
62,
6495,
11930,
1330,
569,
1324,
13543,
11930,
198,
6738,
410,
10210,
62,
44506,
13,
26791,
1330,
11169,
62,
29891,
198,
6738,
410,
10210,
62,
44506,
13,
26791,
1330,
336,
1082,
81,
198,
6738,
410,
10210,
62,
44506,
13,
26791,
1330,
14367,
448,
198,
6738,
410,
10210,
62,
44506,
13,
85,
1324,
62,
27349,
1330,
2594,
628,
198,
31,
30416,
13,
8094,
10786,
6495,
11930,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1790,
62,
16794,
11639,
805,
496,
32928,
2139,
286,
410,
1324,
3127,
11537,
198,
31,
12976,
13,
6603,
62,
22866,
198,
4299,
32928,
7,
49464,
2599,
198,
220,
220,
220,
37227,
5124,
1095,
32928,
2139,
286,
410,
1324,
3127,
13,
628,
220,
220,
220,
3467,
65,
198,
220,
220,
220,
220,
220,
220,
220,
21066,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
410,
10210,
410,
1324,
3127,
2594,
32928,
7139,
12,
6495,
11930,
410,
1324,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3127,
62,
3672,
1377,
21633,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27882,
32928,
2139,
13,
628,
220,
220,
220,
3467,
65,
198,
220,
220,
220,
220,
220,
220,
220,
410,
10210,
410,
1324,
3127,
2594,
32928,
900,
12,
12286,
12,
2673,
410,
1324,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3127,
62,
3672,
1377,
2673,
1249,
1377,
6404,
12,
2673,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5345,
390,
1721,
2223,
287,
32928,
2139,
13,
628,
220,
220,
220,
3467,
65,
198,
220,
220,
220,
220,
220,
220,
220,
410,
10210,
410,
1324,
3127,
2594,
32928,
1351,
410,
1324,
62,
3672,
3127,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7343,
32928,
3173,
287,
32928,
2139,
13,
628,
220,
220,
220,
3467,
65,
198,
220,
220,
220,
220,
220,
220,
220,
410,
10210,
410,
1324,
3127,
2594,
32928,
751,
410,
1324,
62,
3672,
3127,
62,
3672,
3896,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1377,
21633,
1377,
30586,
4268,
1377,
11235,
4668,
82,
309,
13155,
11,
52,
26059,
1377,
10459,
12,
541,
4377,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1377,
10459,
12,
634,
12,
9521,
4377,
1377,
16520,
1883,
12,
634,
12,
9521,
4377,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1377,
16520,
1883,
12,
541,
4377,
1377,
21633,
12,
6404,
2667,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3060,
32928,
3896,
287,
32928,
2139,
13,
628,
220,
220,
220,
3467,
65,
198,
220,
220,
220,
220,
220,
220,
220,
410,
10210,
410,
1324,
3127,
2594,
32928,
4296,
410,
1324,
62,
3672,
3127,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3896,
62,
3672,
1377,
3672,
3896,
62,
3605,
62,
3672,
1377,
21633,
1377,
30586,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4268,
1377,
11235,
4668,
82,
309,
13155,
11,
52,
26059,
1377,
10459,
12,
541,
4377,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1377,
10459,
12,
634,
12,
9521,
4377,
1377,
16520,
1883,
12,
634,
12,
9521,
4377,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1377,
16520,
1883,
12,
541,
4377,
1377,
21633,
12,
6404,
2667,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10133,
32928,
3896,
287,
32928,
2139,
13,
628,
220,
220,
220,
3467,
65,
198,
220,
220,
220,
220,
220,
220,
220,
410,
10210,
410,
1324,
3127,
2594,
32928,
12233,
410,
1324,
62,
3672,
3127,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1377,
3672,
32928,
62,
25135,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23520,
32928,
3896,
287,
32928,
2139,
13,
198,
220,
220,
220,
37227,
628,
198,
4299,
651,
62,
85,
1324,
62,
27349,
62,
6495,
11930,
7,
49464,
11,
410,
1324,
62,
3672,
11,
3127,
62,
3672,
2599,
198,
220,
220,
220,
37227,
3855,
262,
569,
1324,
13543,
11930,
2134,
13,
628,
220,
220,
220,
632,
481,
11169,
10991,
611,
21350,
13,
632,
481,
9743,
262,
5456,
290,
198,
220,
220,
220,
8075,
262,
569,
1324,
13543,
11930,
2134,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11169,
62,
29891,
7,
49464,
11,
410,
17896,
62,
35827,
28,
17821,
8,
198,
220,
220,
220,
5456,
796,
269,
17602,
13,
26801,
17816,
16366,
20520,
198,
220,
220,
220,
410,
1324,
62,
34985,
13155,
796,
569,
1324,
13543,
11930,
7,
16366,
11,
410,
1324,
62,
3672,
11,
3127,
62,
3672,
8,
198,
220,
220,
220,
1441,
410,
1324,
62,
34985,
13155,
628,
198,
31,
6495,
11930,
13,
21812,
10786,
21633,
12,
6495,
11930,
3256,
1790,
62,
16794,
11639,
36695,
32928,
2139,
11537,
198,
31,
12976,
13,
6603,
62,
22866,
198,
31,
12976,
13,
49140,
10786,
85,
1324,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
85,
1324,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
49140,
10786,
27349,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
27349,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
18076,
10786,
438,
21633,
14,
438,
40223,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
271,
62,
25616,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
271,
62,
21633,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
21633,
32928,
2139,
11537,
628,
198,
31,
6495,
11930,
13,
21812,
10786,
2617,
12,
12286,
12,
2673,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1790,
62,
16794,
11639,
2617,
4277,
2223,
286,
32928,
2139,
11537,
198,
31,
12976,
13,
6603,
62,
22866,
198,
31,
12976,
13,
49140,
10786,
85,
1324,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
85,
1324,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
49140,
10786,
27349,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
27349,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
18076,
10786,
438,
2673,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
2673,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
11639,
14781,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
2673,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
2934,
1878,
586,
2223,
319,
32928,
2139,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
21633,
12,
6404,
12,
2673,
14,
438,
40223,
12,
6404,
12,
2673,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
6404,
62,
2673,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
6404,
62,
2673,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
12286,
2223,
319,
32928,
2139,
2604,
11537,
628,
198,
31,
6495,
11930,
13,
21812,
10786,
2860,
3256,
1790,
62,
16794,
11639,
2860,
32928,
3896,
284,
32928,
2139,
11537,
198,
31,
12976,
13,
6603,
62,
22866,
198,
31,
12976,
13,
49140,
10786,
85,
1324,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
85,
1324,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
49140,
10786,
27349,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
27349,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
49140,
10786,
6495,
11930,
62,
25135,
62,
3672,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
6495,
11930,
12,
25135,
12,
3672,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2672,
28,
17821,
8,
198,
31,
12976,
13,
18076,
10786,
438,
21633,
14,
438,
40223,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
271,
62,
21633,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
271,
62,
21633,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
21633,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
30586,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
30586,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
11639,
14781,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
30586,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
30586,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
11235,
4668,
82,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
11235,
4668,
82,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
11235,
4668,
82,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
439,
8435,
3891,
287,
39650,
11266,
5794,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
10459,
12,
634,
12,
9521,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10459,
62,
634,
62,
9521,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
11639,
7149,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
10459,
62,
634,
62,
9521,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
10459,
2493,
2837,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
10459,
12,
541,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10459,
62,
541,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
11639,
7149,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
10459,
62,
541,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
10459,
20966,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
16520,
1883,
12,
634,
12,
9521,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
16520,
1883,
62,
634,
62,
9521,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
11639,
7149,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
16520,
1883,
62,
634,
62,
9521,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
16520,
1883,
2493,
2837,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
16520,
1883,
12,
541,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
16520,
1883,
62,
541,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
11639,
7149,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
16520,
1883,
62,
541,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
16520,
1883,
20966,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
21633,
12,
6404,
2667,
14,
438,
40223,
12,
6404,
2667,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
271,
62,
6404,
2667,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
17821,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
271,
62,
6404,
2667,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
21633,
18931,
319,
32928,
3896,
11537,
628,
198,
31,
6495,
11930,
13,
21812,
10786,
4868,
3256,
1790,
62,
16794,
11639,
4868,
32928,
3173,
287,
32928,
2139,
11537,
198,
31,
12976,
13,
6603,
62,
22866,
198,
31,
12976,
13,
49140,
10786,
85,
1324,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
85,
1324,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
49140,
10786,
27349,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
27349,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
628,
198,
31,
6495,
11930,
13,
21812,
10786,
19119,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1790,
62,
16794,
11639,
19119,
32928,
3896,
286,
32928,
2139,
11537,
198,
31,
12976,
13,
6603,
62,
22866,
198,
31,
12976,
13,
49140,
10786,
85,
1324,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
85,
1324,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
49140,
10786,
27349,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
27349,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
49140,
10786,
6495,
11930,
62,
25135,
62,
3672,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
6495,
11930,
12,
25135,
12,
3672,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2672,
28,
17821,
8,
198,
31,
12976,
13,
18076,
10786,
438,
3672,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3605,
62,
3672,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
3605,
62,
3672,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
3605,
1438,
286,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
21633,
14,
438,
40223,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
271,
62,
21633,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
271,
62,
21633,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
21633,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
30586,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
30586,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
30586,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
30586,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
11235,
4668,
82,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
11235,
4668,
82,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
11235,
4668,
82,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
439,
8435,
3891,
287,
39650,
11266,
5794,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
10459,
12,
634,
12,
9521,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10459,
62,
634,
62,
9521,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
10459,
62,
634,
62,
9521,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
10459,
2493,
2837,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
10459,
12,
541,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10459,
62,
541,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
10459,
62,
541,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
10459,
20966,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
16520,
1883,
12,
634,
12,
9521,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
16520,
1883,
62,
634,
62,
9521,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
16520,
1883,
62,
634,
62,
9521,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
16520,
1883,
2493,
2837,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
16520,
1883,
12,
541,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
16520,
1883,
62,
541,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
16520,
1883,
62,
541,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
16520,
1883,
20966,
319,
32928,
3896,
11537,
198,
31,
12976,
13,
18076,
10786,
438,
21633,
12,
6404,
2667,
14,
438,
40223,
12,
6404,
2667,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
271,
62,
6404,
2667,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
28,
14202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
271,
62,
6404,
2667,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1037,
11639,
21633,
18931,
319,
32928,
3896,
11537,
628,
198,
31,
6495,
11930,
13,
21812,
10786,
33678,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1790,
62,
16794,
11639,
33678,
32928,
3896,
287,
32928,
2139,
11537,
198,
31,
12976,
13,
6603,
62,
22866,
198,
31,
12976,
13,
49140,
10786,
85,
1324,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
85,
1324,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
49140,
10786,
27349,
62,
3672,
3256,
1138,
615,
283,
11639,
27,
27349,
12,
3672,
29,
3256,
2672,
28,
17821,
8,
198,
31,
12976,
13,
49140,
10786,
6495,
11930,
62,
25135,
62,
3672,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1138,
615,
283,
11639,
27,
6495,
11930,
12,
25135,
12,
3672,
29,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2672,
28,
17821,
8,
198
] | 2.287694 | 3,681 |
import graphene
from graphene import relay
from api.schema.benefit import BenefitQuery
from api.schema.branch import BranchQuery
from api.schema.cultural_fit import CulturalFitQuery
from api.schema.dashboard import DashboardQuery
from api.schema.faq_category import FAQCategoryQuery
from api.schema.company import CompanyProfileMutation, CompanyQuery, UniversityProfileMutation
from api.schema.attachment import AttachmentMutation, AttachmentQuery
from api.schema.employee import EmployeeMutation
from api.schema.job_requirement import JobRequirementQuery
from api.schema.job_type import JobTypeQuery
from api.schema.job_posting import JobPostingMutation, JobPostingQuery
from api.schema.keyword.schema import KeywordQuery
from api.schema.language import LanguageQuery
from api.schema.auth import AuthMutation, LogoutMutation, VerifyPasswordResetToken
from api.schema.language_level import LanguageLevelQuery
from api.schema.match import MatchQuery, MatchMutation
from api.schema.project_posting.schema import ProjectPostingQuery, ProjectPostingMutation
from api.schema.project_type.schema import ProjectTypeQuery
from api.schema.skill import SkillQuery
from api.schema.soft_skill import SoftSkillQuery
from api.schema.student import StudentProfileMutation, StudentQuery
from api.schema.registration import RegistrationMutation
from api.schema.topic.schema import TopicQuery
from api.schema.upload import UploadMutation
from api.schema.upload.schema import UploadConfigurationQuery
from api.schema.user import UserQuery
from api.schema.user_request import UserRequestMutation
from api.schema.zip_city import ZipCityQuery
schema = graphene.Schema(query=Query, mutation=Mutation)
| [
11748,
42463,
198,
198,
6738,
42463,
1330,
24248,
198,
6738,
40391,
13,
15952,
2611,
13,
48649,
1330,
38065,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
1671,
3702,
1330,
20551,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
30844,
62,
11147,
1330,
23897,
31805,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
42460,
3526,
1330,
16189,
3526,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
13331,
80,
62,
22872,
1330,
18749,
27313,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
39722,
1330,
5834,
37046,
44,
7094,
11,
5834,
20746,
11,
2059,
37046,
44,
7094,
198,
6738,
40391,
13,
15952,
2611,
13,
1078,
15520,
1330,
3460,
15520,
44,
7094,
11,
3460,
15520,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
7033,
1453,
1330,
36824,
44,
7094,
198,
6738,
40391,
13,
15952,
2611,
13,
21858,
62,
8897,
24615,
1330,
15768,
16844,
24615,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
21858,
62,
4906,
1330,
15768,
6030,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
21858,
62,
7353,
278,
1330,
15768,
6307,
278,
44,
7094,
11,
15768,
6307,
278,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
2539,
4775,
13,
15952,
2611,
1330,
7383,
4775,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
16129,
1330,
15417,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
18439,
1330,
26828,
44,
7094,
11,
5972,
448,
44,
7094,
11,
49899,
35215,
4965,
316,
30642,
198,
6738,
40391,
13,
15952,
2611,
13,
16129,
62,
5715,
1330,
15417,
4971,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
15699,
1330,
13225,
20746,
11,
13225,
44,
7094,
198,
6738,
40391,
13,
15952,
2611,
13,
16302,
62,
7353,
278,
13,
15952,
2611,
1330,
4935,
6307,
278,
20746,
11,
4935,
6307,
278,
44,
7094,
198,
6738,
40391,
13,
15952,
2611,
13,
16302,
62,
4906,
13,
15952,
2611,
1330,
4935,
6030,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
42401,
1330,
16023,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
4215,
62,
42401,
1330,
8297,
35040,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
50139,
1330,
13613,
37046,
44,
7094,
11,
13613,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
2301,
33397,
1330,
24610,
44,
7094,
198,
6738,
40391,
13,
15952,
2611,
13,
26652,
13,
15952,
2611,
1330,
47373,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
25850,
1330,
36803,
44,
7094,
198,
6738,
40391,
13,
15952,
2611,
13,
25850,
13,
15952,
2611,
1330,
36803,
38149,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
7220,
1330,
11787,
20746,
198,
6738,
40391,
13,
15952,
2611,
13,
7220,
62,
25927,
1330,
11787,
18453,
44,
7094,
198,
6738,
40391,
13,
15952,
2611,
13,
13344,
62,
19205,
1330,
38636,
14941,
20746,
628,
628,
198,
15952,
2611,
796,
42463,
13,
27054,
2611,
7,
22766,
28,
20746,
11,
15148,
28,
44,
7094,
8,
198
] | 3.707048 | 454 |
import pandas as pd
import h5py
from sentence_transformers import SentenceTransformer, util
import re
import pickle
class Sample():
"""Samples a relevant paper given an input, using corpus_embeddings
"""
def sample(self, paper_id, abstract, title):
"""Given paper_text ( = paper_abstract+paper_title), samples out the most relevant paper
Args:
paper_id (str): the arxiv id of the paper which is treated as the starting point
abstract (str): abstract of paper
title (str) : title of paper
Returns:
[type]: [description]
"""
paper_text = abstract + ' ' + title
paper_text = self.clean_text(paper_text)
# get the vector for query paper
query_embedding = self.model.encode(paper_text, convert_to_tensor=True)
# retrieve top similar papers
search_hits = util.semantic_search(query_embedding, self.corpus_embeddings)[0]
# do softmax normalization and sampling using random strategy
next_paper_id = self.corpus_ids[search_hits[0]['corpus_id']]
if next_paper_id == paper_id:
next_paper_id = self.corpus_ids[search_hits[1]['corpus_id']]
return str(next_paper_id)
if __name__=='__main__':
paper_id = '0704.0001'
title = "Calculation of prompt diphoton production cross sections at Tevatron and LHC energies"
abstract = '''A fully differential calculation in perturbative quantum chromodynamics is presented for
the production of massive photon pairs at hadron colliders. All next-to-leading order perturbative
contributions from quark-antiquark, gluon-(anti)quark, and gluon-gluon subprocesses are included,
as well as all-orders resummation of initial-state gluon radiation valid at next-to-next-to-leading
logarithmic accuracy. The region of phase space is specified in which the calculation is most reliable.
Good agreement is demonstrated with data from the Fermilab Tevatron, and predictions are made for more
detailed tests with CDF and DO data. Predictions are shown for distributions of diphoton pairs produced
at the energy of the Large Hadron Collider (LHC). Distributions of the diphoton pairs from the decay of
a Higgs boson are contrasted with those produced from QCD processes at the LHC, showing that enhanced
sensitivity to the signal can be obtained with judicious selection of events.'''
sample = Sample()
result = sample.sample(paper_id, abstract, title)
print(result) | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
289,
20,
9078,
198,
6738,
6827,
62,
35636,
364,
1330,
11352,
594,
8291,
16354,
11,
7736,
198,
11748,
302,
198,
11748,
2298,
293,
628,
198,
4871,
27565,
33529,
198,
220,
220,
220,
37227,
50,
12629,
257,
5981,
3348,
1813,
281,
5128,
11,
1262,
35789,
62,
20521,
67,
654,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
6291,
7,
944,
11,
3348,
62,
312,
11,
12531,
11,
3670,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
15056,
3348,
62,
5239,
357,
796,
3348,
62,
397,
8709,
10,
20189,
62,
7839,
828,
8405,
503,
262,
749,
5981,
3348,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3348,
62,
312,
357,
2536,
2599,
262,
610,
87,
452,
4686,
286,
262,
3348,
543,
318,
5716,
355,
262,
3599,
966,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12531,
357,
2536,
2599,
12531,
286,
3348,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3670,
357,
2536,
8,
220,
220,
1058,
3670,
286,
3348,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
685,
4906,
5974,
685,
11213,
60,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
3348,
62,
5239,
796,
12531,
1343,
705,
705,
1343,
3670,
198,
220,
220,
220,
220,
220,
220,
220,
3348,
62,
5239,
796,
2116,
13,
27773,
62,
5239,
7,
20189,
62,
5239,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
651,
262,
15879,
329,
12405,
3348,
198,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
20521,
12083,
796,
2116,
13,
19849,
13,
268,
8189,
7,
20189,
62,
5239,
11,
10385,
62,
1462,
62,
83,
22854,
28,
17821,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
19818,
1353,
2092,
9473,
198,
220,
220,
220,
220,
220,
220,
220,
2989,
62,
71,
896,
796,
7736,
13,
43616,
5109,
62,
12947,
7,
22766,
62,
20521,
12083,
11,
2116,
13,
10215,
79,
385,
62,
20521,
67,
654,
38381,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
466,
2705,
9806,
3487,
1634,
290,
19232,
1262,
4738,
4811,
198,
220,
220,
220,
220,
220,
220,
220,
1306,
62,
20189,
62,
312,
796,
2116,
13,
10215,
79,
385,
62,
2340,
58,
12947,
62,
71,
896,
58,
15,
7131,
6,
10215,
79,
385,
62,
312,
6,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1306,
62,
20189,
62,
312,
6624,
3348,
62,
312,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1306,
62,
20189,
62,
312,
796,
2116,
13,
10215,
79,
385,
62,
2340,
58,
12947,
62,
71,
896,
58,
16,
7131,
6,
10215,
79,
385,
62,
312,
6,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
965,
7,
19545,
62,
20189,
62,
312,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628,
198,
361,
11593,
3672,
834,
855,
6,
834,
12417,
834,
10354,
198,
220,
220,
220,
3348,
62,
312,
796,
705,
15,
32869,
13,
18005,
6,
198,
220,
220,
220,
3670,
796,
366,
9771,
14902,
286,
6152,
19550,
8940,
261,
3227,
3272,
9004,
379,
1665,
85,
23484,
290,
406,
16045,
27598,
1,
198,
220,
220,
220,
12531,
796,
705,
7061,
32,
3938,
22577,
17952,
287,
22146,
5945,
876,
14821,
15358,
44124,
318,
5545,
329,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
262,
3227,
286,
4858,
48190,
14729,
379,
550,
1313,
2927,
4157,
13,
1439,
1306,
12,
1462,
12,
12294,
1502,
22146,
5945,
876,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9284,
422,
627,
668,
12,
415,
1557,
668,
11,
1278,
84,
261,
30420,
17096,
8,
421,
668,
11,
290,
1278,
84,
261,
12,
70,
2290,
261,
850,
14681,
274,
389,
3017,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
355,
880,
355,
477,
12,
6361,
581,
13929,
341,
286,
4238,
12,
5219,
1278,
84,
261,
11881,
4938,
379,
1306,
12,
1462,
12,
19545,
12,
1462,
12,
12294,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2604,
283,
342,
9383,
9922,
13,
383,
3814,
286,
7108,
2272,
318,
7368,
287,
543,
262,
17952,
318,
749,
9314,
13,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4599,
4381,
318,
9555,
351,
1366,
422,
262,
376,
7780,
346,
397,
1665,
85,
23484,
11,
290,
16277,
389,
925,
329,
517,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6496,
5254,
351,
6458,
37,
290,
8410,
1366,
13,
14322,
9278,
389,
3402,
329,
24570,
286,
19550,
8940,
261,
14729,
4635,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
379,
262,
2568,
286,
262,
13601,
11161,
1313,
50253,
357,
43,
16045,
737,
46567,
507,
286,
262,
19550,
8940,
261,
14729,
422,
262,
22119,
286,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
367,
20340,
37284,
261,
389,
49754,
351,
883,
4635,
422,
1195,
8610,
7767,
379,
262,
406,
16045,
11,
4478,
326,
13105,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14233,
284,
262,
6737,
460,
307,
6492,
351,
2553,
6243,
6356,
286,
2995,
2637,
7061,
198,
220,
220,
220,
220,
198,
220,
220,
220,
6291,
796,
27565,
3419,
198,
220,
220,
220,
1255,
796,
6291,
13,
39873,
7,
20189,
62,
312,
11,
12531,
11,
3670,
8,
198,
220,
220,
220,
3601,
7,
20274,
8
] | 2.646712 | 1,019 |
# Copyright (c) Facebook, Inc. and its affiliates.
from mmf.common.registry import registry
from mmf.datasets.builders.visual_genome.builder import VisualGenomeBuilder
from mmf.datasets.builders.visual_genome.masked_dataset import MaskedVisualGenomeDataset
@registry.register_builder("masked_visual_genome")
| [
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
198,
198,
6738,
8085,
69,
13,
11321,
13,
2301,
4592,
1330,
20478,
198,
6738,
8085,
69,
13,
19608,
292,
1039,
13,
50034,
13,
41464,
62,
5235,
462,
13,
38272,
1330,
15612,
13746,
462,
32875,
198,
6738,
8085,
69,
13,
19608,
292,
1039,
13,
50034,
13,
41464,
62,
5235,
462,
13,
27932,
276,
62,
19608,
292,
316,
1330,
18007,
276,
36259,
13746,
462,
27354,
292,
316,
628,
198,
31,
2301,
4592,
13,
30238,
62,
38272,
7203,
27932,
276,
62,
41464,
62,
5235,
462,
4943,
198
] | 3.206186 | 97 |
from unittest import TestCase
from core.download import DownloadHelperMulti, DownLoadUrl, DownLoadUrlAdvance
# def test
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
4755,
13,
15002,
1330,
10472,
47429,
29800,
11,
5588,
8912,
28165,
11,
5588,
8912,
28165,
2782,
19259,
628,
198,
220,
220,
220,
1303,
825,
1332,
628,
198
] | 3.486486 | 37 |
#!/usr/bin/env python3
# The MIT License (MIT)
#
# Copyright (c) 2017 allancth
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
fn = lambda a: a + 1
arg = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
r = map(fn, arg)
for e in r:
print("{0}".format(e))
r = map(fn_map, arg)
for e in r:
print(">> {0}".format(e))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
2177,
477,
272,
310,
71,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
220,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
220,
198,
2,
287,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
220,
198,
2,
284,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
220,
198,
2,
9088,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
220,
198,
2,
30760,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
198,
2,
198,
2,
383,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
477,
198,
2,
9088,
393,
8904,
16690,
286,
262,
10442,
13,
198,
2,
198,
2,
3336,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
220,
198,
2,
8959,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
220,
198,
2,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
220,
198,
2,
37195,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
220,
198,
2,
43031,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
220,
198,
2,
16289,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
220,
198,
2,
47466,
13,
198,
198,
22184,
796,
37456,
257,
25,
257,
1343,
352,
198,
853,
796,
685,
657,
11,
352,
11,
362,
11,
513,
11,
604,
11,
642,
11,
718,
11,
767,
11,
807,
11,
860,
2361,
198,
81,
796,
3975,
7,
22184,
11,
1822,
8,
198,
1640,
304,
287,
374,
25,
198,
220,
220,
220,
3601,
7203,
90,
15,
92,
1911,
18982,
7,
68,
4008,
198,
198,
81,
796,
3975,
7,
22184,
62,
8899,
11,
1822,
8,
198,
1640,
304,
287,
374,
25,
198,
220,
220,
220,
3601,
7203,
4211,
1391,
15,
92,
1911,
18982,
7,
68,
4008,
628
] | 3.241463 | 410 |
from pathlib import Path
EXP_NAME = 'Transformer32'
EPOCH = 20
EMBEDDING_DIM = 64
ENCODER_STACK = 6
ATTENTION_HEAD = 1
DROPOUT = 0.1
LR = 0.0001
BATCH_SIZE = 32
AUGMENTATION = None
MAX_FEATURE = 32
SMOTE_SEED = 23904
PYTORCH_SEED = 321295675063
PYTHON_SEED = 123146427
ML_SEED = 32129
MODEL_DIR = Path.cwd() / "models" / EXP_NAME
if not MODEL_DIR.exists():
MODEL_DIR.mkdir(parents=True)
FEATURES = ['Baseline Features', 'Intensity Parameters', 'Formant Frequencies', 'Bandwidth Parameters',
'Vocal Fold', 'MFCC', 'Wavelet Features', 'TQWT Features']
FEATURE_GROUPS = ['Basic Info', 'Baseline Features', 'Intensity Parameters', 'Formant Frequencies',
'Bandwidth Parameters', 'Vocal Fold', 'MFCC', 'Wavelet Features', 'TQWT Features']
| [
6738,
3108,
8019,
1330,
10644,
198,
198,
49864,
62,
20608,
796,
705,
8291,
16354,
2624,
6,
198,
8905,
46,
3398,
796,
1160,
198,
3620,
33,
1961,
35,
2751,
62,
35,
3955,
796,
5598,
198,
24181,
3727,
1137,
62,
2257,
8120,
796,
718,
198,
17139,
45589,
62,
37682,
796,
352,
198,
7707,
3185,
12425,
796,
657,
13,
16,
198,
35972,
796,
657,
13,
18005,
198,
33,
11417,
62,
33489,
796,
3933,
198,
32,
7340,
10979,
6234,
796,
6045,
198,
22921,
62,
15112,
40086,
796,
3933,
198,
198,
12310,
23051,
62,
5188,
1961,
796,
32817,
3023,
198,
47,
56,
32961,
3398,
62,
5188,
1961,
796,
3933,
1065,
3865,
3134,
1120,
5066,
198,
47,
56,
4221,
1340,
62,
5188,
1961,
796,
17031,
1415,
2414,
1983,
198,
5805,
62,
5188,
1961,
796,
3933,
18741,
198,
198,
33365,
3698,
62,
34720,
796,
10644,
13,
66,
16993,
3419,
1220,
366,
27530,
1,
1220,
25703,
62,
20608,
198,
198,
361,
407,
19164,
3698,
62,
34720,
13,
1069,
1023,
33529,
198,
220,
220,
220,
19164,
3698,
62,
34720,
13,
28015,
15908,
7,
23743,
28,
17821,
8,
198,
198,
15112,
47471,
796,
37250,
15522,
4470,
17571,
3256,
705,
5317,
6377,
40117,
3256,
705,
8479,
415,
22192,
3976,
3256,
705,
31407,
10394,
40117,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
53,
4374,
39957,
3256,
705,
49800,
4093,
3256,
705,
39709,
1616,
17571,
3256,
705,
51,
48,
39386,
17571,
20520,
198,
198,
15112,
40086,
62,
10761,
2606,
3705,
796,
37250,
26416,
14151,
3256,
705,
15522,
4470,
17571,
3256,
705,
5317,
6377,
40117,
3256,
705,
8479,
415,
22192,
3976,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
31407,
10394,
40117,
3256,
705,
53,
4374,
39957,
3256,
705,
49800,
4093,
3256,
705,
39709,
1616,
17571,
3256,
705,
51,
48,
39386,
17571,
20520,
198
] | 2.473016 | 315 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 11:55:42 2020
@author: esteban
"""
# Este script necesita que instales
# conda install geopandas
#conda install -c conda-forge descartes
fechaAAnalizar='2020-05-04'
alFecha=" al 04/05"
cuarentena_total=['Arica',
'Estación Central',
'Independencia',
'El Bosque',
'Quinta Normal',
'Pedro Aguirre Cerda',
'Angol','Victoria',
'Punta Arenas']
cuarentena_parcial=['San Ramón',
'La Pintana',
'Ñuñoa',
'Santiago',
'Puente Alto',
'San Bernardo']
import geopandas as gp
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import sys
import unicodedata
def strip_accents(text):
try:
text = unicode(text, 'utf-8')
except NameError: # unicode is a default on python 3
pass
text = unicodedata.normalize('NFD', text)\
.encode('ascii', 'ignore')\
.decode("utf-8")
return str(text)
s = strip_accents('àéêöhello')
#print(s)
#reload(sys)
#sys.setdefaultencoding('utf8')
## Primero necesitamos cargar los polígonos de las comunas.
# poligonos descargados desde https://www.bcn.cl/siit/mapas_vectoriales/index_html
shp_path = "../../fuentes/geometrias_comunas/comunas.shp"
comunasChile = gp.read_file(shp_path)
#aprovechamos al toque de calcular la superficie de cada comuna en km2
comunasChile['superficie']=comunasChile.to_crs({'init': 'epsg:3035'}).area/10**6
## Luego cargamos los datos del COVID19
datos_path="../../Consolidado_COVID19_Chile_Comunas.CSV"
#datos_path="../../COVID19_Chile_Comunas-casos_totales.CSV"
datosComunas = pd.read_csv(datos_path)
df=datosComunas
#################################### Aumento porcentual
############ Idea 1
fechas=df.fecha.unique()
i=1
df_old=df
while i<len(fechas):
old=df[df.fecha==fechas[i-1]][['id_comuna','casos_totales']]
old=old.rename(columns={'casos_totales':'casos_totales_old'})
# Si mantenemos la fecha del new, donde vamos a calcular los casos nuevos
new=df[df.fecha==fechas[i]][['fecha','id_comuna','casos_totales']]
new=new.rename(columns={'casos_totales':'casos_totales_new'})
old_new=pd.merge(old,new,on=['id_comuna'])
old_new['var%1periodo']=(old_new.casos_totales_new-old_new.casos_totales_old)*100/old_new.casos_totales_old
old_new=old_new[['fecha','id_comuna','var%1periodo']]
if (i==1):
#para el primero hacemos merge, porque la columna casos_nuevos no existe en df
df=pd.merge(df,old_new,how='left',on=['fecha','id_comuna'])
else:
df_aporte=pd.merge(df_old,old_new,how='left',on=['fecha','id_comuna'])
#para todo el resto tenemos que sobreescribir los datos
df[df.fecha==fechas[i]]=df_aporte[df_aporte.fecha==fechas[i]]
i=i+1
df['var%1periodo']=df['var%1periodo'].fillna(0)
df['var%1periodo']=df['var%1periodo'].replace([np.inf, -np.inf], np.nan).fillna(0)
########### Idea 2
df=df[df.fecha==fechaAAnalizar]
'''
comunasChile.columns =
Index(['objectid', 'shape_leng', 'dis_elec', 'cir_sena', 'cod_comuna',
'codregion', 'st_area_sh', 'st_length_', 'Region', 'Comuna',
'Provincia', 'geometry'],
dtype='object')
'''
## Necesitamos que las columnas tengan el mismo nombre:
comunasChile['nombre_comuna']=comunasChile.Comuna
############################################################
df=comunasChile.merge(df, on='nombre_comuna')
'''
df.columns=
Index(['id_region', 'nombre_region', 'id_comuna', 'nombre_comuna', 'poblacion',
'casos_totales', 'tasa', 'objectid', 'shape_leng', 'dis_elec',
'cir_sena', 'cod_comuna', 'codregion', 'st_area_sh', 'st_length_',
'Region', 'Comuna', 'Provincia', 'geometry'],
dtype='object')
### Los datos por Comuna tienen que ser arreglados.
# Primero, a partir de la columna de tasa y la de población, hay que
# reconstruir los datos de los casos (porque sólo informan cuando hay más
# de 4 casos)
df['casos_totales']=df.casos_totales.replace('-',0)
df['casos_totales']=df.casos_totales.fillna(0)
df['casos_totales']=df.casos_totales.astype(int)
df['tasa']=df.tasa.fillna(0)
df['tasa']=df.tasa.astype(float)
df['poblacion']=df.poblacion.fillna(0)
##Ahora corregimos los datos de los casos totales.
df['casos_totales']=(df.tasa*df.poblacion/100000).round(0).astype(int)
'''
df['nombre_comuna']=df.nombre_comuna.replace('San Juan de la Costa','S.J. de la Costa')
######################################
######################################
######################################
######################################
# CALCULO DE RIESGO = casos*poblacion/superficie
######################################
######################################
######################################
######################################
df['riesgo']=df['casos_totales']*df['poblacion']/df['superficie']
# Lo normalizamos!
df['riesgo']=df['riesgo']/df['riesgo'].max()
df['casos_pp']=df['casos_totales']/df['poblacion']*100000
df['casos_totales']=df['casos_totales'].astype(int)
df['casos_activos']=df['casos_activos'].astype(int)
df['riesgo_activos']=df['casos_activos']*df['poblacion']/df['superficie']
# Lo normalizamos!
df['riesgo_activos']=df['riesgo_activos']/df['riesgo_activos'].max()
df['casos_activos_pp']=df['casos_activos']/df['poblacion']*100000
import seaborn as sns
casos=[['casos_totales','Casos Totales','%i'],
['riesgo','Indice de Riesgo','%.2f'],
['casos_pp','Casos por 100.000 habitantes','%i'],
['riesgo_activos','Índice de Riesgo Activo','%.2f'],
['casos_activos','Casos Activos','%i'],
['casos_activos_pp','Casos Activos por 100.000 hbs.','%i'],
['var%1periodo','Variacion % 1 periodo','%i'],
]
#Datos al 18 de Abril
for caso in casos:
caracteristica=caso[0]
titulo=caso[1]
t=caso[2]
#top10=df[df.nombre_region!='Metropolitana'][['nombre_comuna',caracteristica]].sort_values(caracteristica,ascending=False).head(10)
top10=df[['nombre_comuna',caracteristica]].sort_values(caracteristica,ascending=False).head(10)
top10=top10.reset_index(drop=True)
print(top10)
paleta_rojos=['red']*10#sns.color_palette("Reds",10)#sns.color_palette("bwr",50)[40:50]
paleta_verdes=['lime']*10#sns.color_palette("Greens_r",20)[0:10]
yellow=[(255/255, 198/255, 0/255)]*10
paleta_naranjos=yellow#['yellow']*10#sns.color_palette("Oranges_r",20)[0:10]
paleta=paleta_verdes#['green']*10 #sns.color_palette("winter",10)
i=0
for bool in top10.nombre_comuna.isin(cuarentena_total):
if bool:
paleta[i]=paleta_rojos[i]#'tomato'
i+=1
i=0
for bool in top10.nombre_comuna.isin(cuarentena_parcial):
if bool:
paleta[i]=paleta_naranjos[i]#'lightyellow'
i+=1
sns.set(font_scale=2)
# sns.set_style("ticks")
sns.set_style("whitegrid")
alto=11
ancho=8
f, ax = plt.subplots(figsize=(ancho, alto))
sns.barplot(x=caracteristica, y='nombre_comuna',data=top10,palette=paleta)
sns.despine(left=True, bottom=True)
#ax.set_xticklabels(top10[caracteristica])
for p in ax.patches:
ax.annotate(t % p.get_width(), (p.get_x() + p.get_width(), p.get_y() + 1.2),
xytext=(5, 40), textcoords='offset points')
plt.xlabel(titulo)
plt.title("Top 10 Comunas según "+titulo + alFecha)
plt.ylabel('')
#plt.yticks(rotation=45)
plt.show()
plt.tight_layout()
plt.savefig('indice_comunas'+caracteristica+'.png')
#plt.figure(figsize=(12,8))
# plot barh chart with index as x values
#ax = sns.barplot(top15.index, top10.casos_totales)
#ax.get_yaxis().set_major_formatter(plt.FuncFormatter(lambda x, loc: "{:,}".format(int(x))))
#ax.set(xlabel="Dim", ylabel='Count')
# add proper Dim values as x labels
#ax.set_xticklabels(top15.nombre_comuna)
#for item in ax.get_xticklabels(): item.set_rotation(90)
#for i, v in enumerate(top15["nombre_comuna"].iteritems()):
# ax.text(i ,v[1], "{:,}".format(v[1]), color='m', va ='bottom', rotation=45)
#plt.tight_layout()
#plt.show()
rm= df[df.Region=='Región Metropolitana de Santiago']
gran_stgo_path="../../fuentes/gran_stgo/gran_stgo.csv"
#datos_path="../../COVID19_Chile_Comunas-casos_totales.CSV"
gran_stgo = pd.read_csv(gran_stgo_path)
rm=rm.merge(gran_stgo, left_on='nombre_comuna', right_on='nombre_comuna', sort='False')
stgo= rm[rm.gran_stgo==1]
# Control del tamaño de la figura del mapa
fig, ax = plt.subplots(figsize=(30, 30))
# Control del título y los ejes
ax.set_title(u'Comunas del Gran Santiago por Índice de Riesgo de Contagio',
pad = 20,
fontdict={'fontsize':20, 'color': 'black'})
# Control del título y los ejes
#ax.set_xlabel('Longitud')
#ax.set_ylabel('Latitud')
plt.axis('off')
#ax.legend(fontsize=1000)
# Añadir la leyenda separada del mapa
from mpl_toolkits.axes_grid1 import make_axes_locatable
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.2)
#map_STGO[(map_STGO.NOMBRE!='Santiago')&(map_STGO.NOMBRE!='Providencia')&(map_STGO.NOMBRE!='Ñuñoa')&(map_STGO.NOMBRE!='Las Condes')]
# Mostrar el mapa finalizado
stgo.plot(column='riesgo',
cmap='Reds', ax=ax,
legend=True,
legend_kwds={'label': "Riesgo de Contagio"},
cax=cax, zorder=5,#
missing_kwds={"color": "lightgrey",
"edgecolor": "black",
"hatch": "///"
#"label": "Missing values",
})
fig, ax = plt.subplots(figsize=(30, 30))
'''
stgo.plot(column='riesgo',cmap='Reds', ax=ax,
legend=Truelegend_kwds={'label': "Riesgo de Contagio"},
cax=cax, zorder=5,
missing_kwds={"color": "lightgrey",
"edgecolor": "black",
"hatch": "///" })#,
#"label": "Missing values",})
'''
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
201,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
37811,
201,
41972,
319,
30030,
1526,
3261,
1367,
25,
2816,
25,
3682,
12131,
201,
31,
9800,
25,
1556,
1765,
272,
201,
37811,
201,
201,
2,
412,
4169,
4226,
497,
728,
5350,
8358,
916,
2040,
220,
201,
2,
1779,
64,
2721,
30324,
392,
292,
201,
2,
66,
13533,
2721,
532,
66,
1779,
64,
12,
30293,
1715,
433,
274,
201,
201,
69,
3055,
64,
32,
2025,
282,
528,
283,
11639,
42334,
12,
2713,
12,
3023,
6,
201,
282,
37,
3055,
64,
2625,
435,
8702,
14,
2713,
1,
201,
201,
201,
201,
27399,
1580,
8107,
62,
23350,
28,
17816,
32,
30997,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
22362,
32009,
18840,
5694,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
5497,
2690,
29634,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
9527,
14548,
4188,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
4507,
600,
64,
14435,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
43468,
305,
33118,
343,
260,
17419,
6814,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
13450,
349,
41707,
49898,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
47,
44424,
9843,
292,
20520,
220,
220,
220,
220,
201,
27399,
1580,
8107,
62,
1845,
2413,
28,
17816,
15017,
7431,
18840,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
14772,
350,
600,
2271,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
127,
239,
84,
12654,
12162,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
50,
17096,
3839,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
47,
84,
21872,
34317,
3256,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
15017,
6206,
13109,
20520,
201,
201,
201,
201,
11748,
30324,
392,
292,
355,
27809,
201,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
11748,
19798,
292,
355,
279,
67,
201,
11748,
299,
32152,
355,
45941,
201,
11748,
25064,
201,
201,
201,
11748,
28000,
9043,
1045,
201,
201,
4299,
10283,
62,
4134,
658,
7,
5239,
2599,
201,
201,
220,
220,
220,
1949,
25,
201,
220,
220,
220,
220,
220,
220,
220,
2420,
796,
28000,
1098,
7,
5239,
11,
705,
40477,
12,
23,
11537,
201,
220,
220,
220,
2845,
6530,
12331,
25,
1303,
28000,
1098,
318,
257,
4277,
319,
21015,
513,
220,
201,
220,
220,
220,
220,
220,
220,
220,
1208,
201,
201,
220,
220,
220,
2420,
796,
28000,
9043,
1045,
13,
11265,
1096,
10786,
21870,
35,
3256,
2420,
19415,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
268,
8189,
10786,
292,
979,
72,
3256,
705,
46430,
11537,
59,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
12501,
1098,
7203,
40477,
12,
23,
4943,
201,
201,
220,
220,
220,
1441,
965,
7,
5239,
8,
201,
201,
82,
796,
10283,
62,
4134,
658,
10786,
24247,
2634,
25792,
9101,
31373,
11537,
201,
201,
2,
4798,
7,
82,
8,
201,
201,
2,
260,
2220,
7,
17597,
8,
201,
2,
17597,
13,
2617,
12286,
12685,
7656,
10786,
40477,
23,
11537,
201,
201,
201,
2235,
11460,
3529,
497,
728,
270,
321,
418,
269,
853,
283,
22346,
755,
8836,
14520,
418,
390,
39990,
401,
403,
292,
13,
201,
2,
755,
37107,
418,
1715,
853,
22484,
748,
2934,
3740,
1378,
2503,
13,
15630,
77,
13,
565,
14,
13396,
270,
14,
8899,
292,
62,
31364,
498,
274,
14,
9630,
62,
6494,
201,
1477,
79,
62,
6978,
796,
366,
40720,
40720,
20942,
298,
274,
14,
469,
908,
380,
292,
62,
785,
403,
292,
14,
785,
403,
292,
13,
1477,
79,
1,
201,
785,
403,
292,
1925,
576,
796,
27809,
13,
961,
62,
7753,
7,
1477,
79,
62,
6978,
8,
201,
2,
499,
305,
303,
49869,
418,
435,
284,
4188,
390,
2386,
10440,
8591,
21176,
291,
494,
390,
269,
4763,
401,
9613,
551,
10571,
17,
201,
785,
403,
292,
1925,
576,
17816,
16668,
69,
291,
494,
20520,
28,
785,
403,
292,
1925,
576,
13,
1462,
62,
66,
3808,
15090,
6,
15003,
10354,
705,
25386,
70,
25,
1270,
2327,
6,
92,
737,
20337,
14,
940,
1174,
21,
201,
201,
201,
201,
2235,
406,
518,
2188,
269,
853,
321,
418,
22346,
4818,
418,
1619,
7375,
11008,
1129,
201,
19608,
418,
62,
6978,
2625,
40720,
40720,
9444,
10180,
4533,
62,
8220,
11008,
1129,
62,
1925,
576,
62,
5377,
403,
292,
13,
7902,
53,
1,
201,
2,
19608,
418,
62,
6978,
2625,
40720,
40720,
8220,
11008,
1129,
62,
1925,
576,
62,
5377,
403,
292,
12,
34004,
418,
62,
83,
313,
2040,
13,
7902,
53,
1,
201,
19608,
418,
5377,
403,
292,
796,
279,
67,
13,
961,
62,
40664,
7,
19608,
418,
62,
6978,
8,
201,
201,
7568,
28,
19608,
418,
5377,
403,
292,
201,
201,
29113,
4242,
317,
1713,
78,
16964,
1087,
723,
201,
201,
7804,
4242,
37560,
352,
201,
69,
3055,
292,
28,
7568,
13,
69,
3055,
64,
13,
34642,
3419,
201,
72,
28,
16,
201,
7568,
62,
727,
28,
7568,
201,
4514,
1312,
27,
11925,
7,
69,
3055,
292,
2599,
201,
220,
220,
220,
220,
201,
220,
220,
220,
1468,
28,
7568,
58,
7568,
13,
69,
3055,
64,
855,
69,
3055,
292,
58,
72,
12,
16,
60,
7131,
17816,
312,
62,
785,
9613,
41707,
34004,
418,
62,
83,
313,
2040,
6,
11907,
201,
220,
220,
220,
1468,
28,
727,
13,
918,
480,
7,
28665,
82,
34758,
6,
34004,
418,
62,
83,
313,
2040,
10354,
6,
34004,
418,
62,
83,
313,
2040,
62,
727,
6,
30072,
201,
201,
220,
220,
220,
1303,
15638,
24818,
268,
368,
418,
8591,
730,
11693,
1619,
649,
11,
288,
14378,
410,
321,
418,
257,
2386,
10440,
22346,
6124,
418,
299,
518,
85,
418,
201,
220,
220,
220,
649,
28,
7568,
58,
7568,
13,
69,
3055,
64,
855,
69,
3055,
292,
58,
72,
60,
7131,
17816,
69,
3055,
64,
41707,
312,
62,
785,
9613,
41707,
34004,
418,
62,
83,
313,
2040,
6,
11907,
201,
220,
220,
220,
649,
28,
3605,
13,
918,
480,
7,
28665,
82,
34758,
6,
34004,
418,
62,
83,
313,
2040,
10354,
6,
34004,
418,
62,
83,
313,
2040,
62,
3605,
6,
30072,
201,
220,
220,
220,
1468,
62,
3605,
28,
30094,
13,
647,
469,
7,
727,
11,
3605,
11,
261,
28,
17816,
312,
62,
785,
9613,
6,
12962,
201,
220,
220,
220,
1468,
62,
3605,
17816,
7785,
4,
16,
41007,
78,
20520,
16193,
727,
62,
3605,
13,
34004,
418,
62,
83,
313,
2040,
62,
3605,
12,
727,
62,
3605,
13,
34004,
418,
62,
83,
313,
2040,
62,
727,
27493,
3064,
14,
727,
62,
3605,
13,
34004,
418,
62,
83,
313,
2040,
62,
727,
201,
220,
220,
220,
1468,
62,
3605,
28,
727,
62,
3605,
58,
17816,
69,
3055,
64,
41707,
312,
62,
785,
9613,
41707,
7785,
4,
16,
41007,
78,
6,
11907,
201,
220,
220,
220,
611,
357,
72,
855,
16,
2599,
201,
220,
220,
220,
220,
220,
220,
220,
1303,
1845,
64,
1288,
2684,
3529,
289,
330,
368,
418,
20121,
11,
16964,
4188,
8591,
951,
388,
2616,
6124,
418,
62,
77,
518,
85,
418,
645,
2152,
68,
551,
47764,
201,
220,
220,
220,
220,
220,
220,
220,
47764,
28,
30094,
13,
647,
469,
7,
7568,
11,
727,
62,
3605,
11,
4919,
11639,
9464,
3256,
261,
28,
17816,
69,
3055,
64,
41707,
312,
62,
785,
9613,
6,
12962,
201,
220,
220,
220,
2073,
25,
201,
220,
220,
220,
220,
220,
220,
220,
47764,
62,
499,
419,
68,
28,
30094,
13,
647,
469,
7,
7568,
62,
727,
11,
727,
62,
3605,
11,
4919,
11639,
9464,
3256,
261,
28,
17816,
69,
3055,
64,
41707,
312,
62,
785,
9613,
6,
12962,
201,
220,
220,
220,
220,
220,
220,
220,
1303,
1845,
64,
284,
4598,
1288,
1334,
78,
3478,
368,
418,
8358,
523,
4679,
3798,
822,
343,
22346,
4818,
418,
201,
220,
220,
220,
220,
220,
220,
220,
47764,
58,
7568,
13,
69,
3055,
64,
855,
69,
3055,
292,
58,
72,
11907,
28,
7568,
62,
499,
419,
68,
58,
7568,
62,
499,
419,
68,
13,
69,
3055,
64,
855,
69,
3055,
292,
58,
72,
11907,
201,
220,
220,
220,
220,
220,
220,
220,
220,
201,
220,
220,
220,
1312,
28,
72,
10,
16,
201,
201,
7568,
17816,
7785,
4,
16,
41007,
78,
20520,
28,
7568,
17816,
7785,
4,
16,
41007,
78,
6,
4083,
20797,
2616,
7,
15,
8,
201,
7568,
17816,
7785,
4,
16,
41007,
78,
20520,
28,
7568,
17816,
7785,
4,
16,
41007,
78,
6,
4083,
33491,
26933,
37659,
13,
10745,
11,
532,
37659,
13,
10745,
4357,
45941,
13,
12647,
737,
20797,
2616,
7,
15,
8,
201,
201,
7804,
21017,
37560,
362,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
7568,
28,
7568,
58,
7568,
13,
69,
3055,
64,
855,
69,
3055,
64,
32,
2025,
282,
528,
283,
60,
201,
201,
7061,
6,
201,
785,
403,
292,
1925,
576,
13,
28665,
82,
796,
220,
220,
201,
15732,
7,
17816,
15252,
312,
3256,
705,
43358,
62,
75,
1516,
3256,
705,
6381,
62,
11129,
66,
3256,
705,
66,
343,
62,
6248,
64,
3256,
705,
19815,
62,
785,
9613,
3256,
201,
220,
220,
220,
220,
220,
220,
705,
19815,
36996,
3256,
705,
301,
62,
20337,
62,
1477,
3256,
705,
301,
62,
13664,
62,
3256,
705,
47371,
3256,
705,
5377,
9613,
3256,
201,
220,
220,
220,
220,
220,
220,
705,
15946,
1939,
544,
3256,
705,
469,
15748,
6,
4357,
201,
220,
220,
220,
220,
220,
288,
4906,
11639,
15252,
11537,
201,
7061,
6,
201,
2235,
19652,
274,
270,
321,
418,
8358,
39990,
5721,
292,
3478,
1030,
1288,
32691,
78,
299,
2381,
260,
25,
201,
785,
403,
292,
1925,
576,
17816,
77,
2381,
260,
62,
785,
9613,
20520,
28,
785,
403,
292,
1925,
576,
13,
5377,
9613,
201,
29113,
14468,
7804,
4242,
201,
201,
7568,
28,
785,
403,
292,
1925,
576,
13,
647,
469,
7,
7568,
11,
319,
11639,
77,
2381,
260,
62,
785,
9613,
11537,
201,
201,
201,
7061,
6,
201,
7568,
13,
28665,
82,
28,
201,
15732,
7,
17816,
312,
62,
36996,
3256,
705,
77,
2381,
260,
62,
36996,
3256,
705,
312,
62,
785,
9613,
3256,
705,
77,
2381,
260,
62,
785,
9613,
3256,
705,
79,
45292,
49443,
3256,
201,
220,
220,
220,
220,
220,
220,
705,
34004,
418,
62,
83,
313,
2040,
3256,
705,
83,
15462,
3256,
705,
15252,
312,
3256,
705,
43358,
62,
75,
1516,
3256,
705,
6381,
62,
11129,
66,
3256,
201,
220,
220,
220,
220,
220,
220,
705,
66,
343,
62,
6248,
64,
3256,
705,
19815,
62,
785,
9613,
3256,
705,
19815,
36996,
3256,
705,
301,
62,
20337,
62,
1477,
3256,
705,
301,
62,
13664,
62,
3256,
201,
220,
220,
220,
220,
220,
220,
705,
47371,
3256,
705,
5377,
9613,
3256,
705,
15946,
1939,
544,
3256,
705,
469,
15748,
6,
4357,
201,
220,
220,
220,
220,
220,
288,
4906,
11639,
15252,
11537,
201,
201,
220,
201,
21017,
5401,
4818,
418,
16964,
955,
9613,
256,
2013,
268,
8358,
1055,
610,
2301,
9435,
418,
13,
201,
2,
220,
220,
11460,
3529,
11,
257,
636,
343,
390,
8591,
951,
388,
2616,
390,
256,
15462,
331,
8591,
390,
279,
45292,
32009,
18840,
11,
27678,
8358,
201,
2,
220,
220,
8195,
19554,
343,
22346,
4818,
418,
390,
22346,
6124,
418,
357,
1819,
4188,
264,
10205,
5439,
4175,
272,
18912,
25440,
27678,
285,
40138,
201,
2,
390,
604,
6124,
418,
8,
201,
201,
7568,
17816,
34004,
418,
62,
83,
313,
2040,
20520,
28,
7568,
13,
34004,
418,
62,
83,
313,
2040,
13,
33491,
10786,
12,
3256,
15,
8,
201,
7568,
17816,
34004,
418,
62,
83,
313,
2040,
20520,
28,
7568,
13,
34004,
418,
62,
83,
313,
2040,
13,
20797,
2616,
7,
15,
8,
201,
7568,
17816,
34004,
418,
62,
83,
313,
2040,
20520,
28,
7568,
13,
34004,
418,
62,
83,
313,
2040,
13,
459,
2981,
7,
600,
8,
201,
7568,
17816,
83,
15462,
20520,
28,
7568,
13,
83,
15462,
13,
20797,
2616,
7,
15,
8,
201,
7568,
17816,
83,
15462,
20520,
28,
7568,
13,
83,
15462,
13,
459,
2981,
7,
22468,
8,
201,
7568,
17816,
79,
45292,
49443,
20520,
28,
7568,
13,
79,
45292,
49443,
13,
20797,
2616,
7,
15,
8,
201,
201,
2235,
10910,
5799,
1162,
2301,
320,
418,
22346,
4818,
418,
390,
22346,
6124,
418,
2006,
2040,
13,
201,
7568,
17816,
34004,
418,
62,
83,
313,
2040,
20520,
16193,
7568,
13,
83,
15462,
9,
7568,
13,
79,
45292,
49443,
14,
3064,
830,
737,
744,
7,
15,
737,
459,
2981,
7,
600,
8,
201,
705,
7061,
201,
220,
201,
7568,
17816,
77,
2381,
260,
62,
785,
9613,
20520,
28,
7568,
13,
77,
2381,
260,
62,
785,
9613,
13,
33491,
10786,
15017,
16852,
390,
8591,
18133,
41707,
50,
13,
41,
13,
390,
8591,
18133,
11537,
201,
201,
29113,
4242,
2235,
201,
29113,
4242,
2235,
201,
29113,
4242,
2235,
201,
29113,
4242,
2235,
201,
201,
2,
220,
220,
33290,
34,
6239,
46,
5550,
371,
11015,
11230,
796,
6124,
418,
9,
79,
45292,
49443,
14,
16668,
69,
291,
494,
201,
201,
29113,
4242,
2235,
201,
29113,
4242,
2235,
201,
29113,
4242,
2235,
201,
29113,
4242,
2235,
201,
7568,
17816,
1678,
2188,
20520,
28,
7568,
17816,
34004,
418,
62,
83,
313,
2040,
20520,
9,
7568,
17816,
79,
45292,
49443,
20520,
14,
7568,
17816,
16668,
69,
291,
494,
20520,
201,
2,
6706,
3487,
528,
321,
418,
0,
201,
7568,
17816,
1678,
2188,
20520,
28,
7568,
17816,
1678,
2188,
20520,
14,
7568,
17816,
1678,
2188,
6,
4083,
9806,
3419,
201,
7568,
17816,
34004,
418,
62,
381,
20520,
28,
7568,
17816,
34004,
418,
62,
83,
313,
2040,
20520,
14,
7568,
17816,
79,
45292,
49443,
20520,
9,
3064,
830,
201,
201,
7568,
17816,
34004,
418,
62,
83,
313,
2040,
20520,
28,
7568,
17816,
34004,
418,
62,
83,
313,
2040,
6,
4083,
459,
2981,
7,
600,
8,
201,
7568,
17816,
34004,
418,
62,
15791,
418,
20520,
28,
7568,
17816,
34004,
418,
62,
15791,
418,
6,
4083,
459,
2981,
7,
600,
8,
201,
7568,
17816,
1678,
2188,
62,
15791,
418,
20520,
28,
7568,
17816,
34004,
418,
62,
15791,
418,
20520,
9,
7568,
17816,
79,
45292,
49443,
20520,
14,
7568,
17816,
16668,
69,
291,
494,
20520,
201,
2,
6706,
3487,
528,
321,
418,
0,
201,
7568,
17816,
1678,
2188,
62,
15791,
418,
20520,
28,
7568,
17816,
1678,
2188,
62,
15791,
418,
20520,
14,
7568,
17816,
1678,
2188,
62,
15791,
418,
6,
4083,
9806,
3419,
201,
7568,
17816,
34004,
418,
62,
15791,
418,
62,
381,
20520,
28,
7568,
17816,
34004,
418,
62,
15791,
418,
20520,
14,
7568,
17816,
79,
45292,
49443,
20520,
9,
3064,
830,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
201,
11748,
384,
397,
1211,
355,
3013,
82,
201,
201,
34004,
418,
41888,
17816,
34004,
418,
62,
83,
313,
2040,
41707,
35155,
418,
20323,
2040,
41707,
4,
72,
6,
4357,
201,
220,
220,
220,
220,
220,
220,
37250,
1678,
2188,
41707,
5497,
501,
390,
371,
444,
2188,
41707,
7225,
17,
69,
6,
4357,
201,
220,
220,
220,
220,
220,
220,
37250,
34004,
418,
62,
381,
41707,
35155,
418,
16964,
1802,
13,
830,
7947,
39781,
41707,
4,
72,
6,
4357,
201,
220,
220,
220,
220,
220,
220,
37250,
1678,
2188,
62,
15791,
418,
41707,
38638,
358,
501,
390,
371,
444,
2188,
13144,
78,
41707,
7225,
17,
69,
6,
4357,
201,
220,
220,
220,
220,
220,
220,
37250,
34004,
418,
62,
15791,
418,
41707,
35155,
418,
13144,
418,
41707,
4,
72,
6,
4357,
201,
220,
220,
220,
220,
220,
220,
37250,
34004,
418,
62,
15791,
418,
62,
381,
41707,
35155,
418,
13144,
418,
16964,
1802,
13,
830,
289,
1443,
2637,
4032,
4,
72,
6,
4357,
201,
220,
220,
220,
220,
220,
220,
37250,
7785,
4,
16,
41007,
78,
41707,
23907,
49443,
4064,
352,
2278,
78,
41707,
4,
72,
6,
4357,
220,
220,
220,
220,
220,
220,
220,
201,
220,
220,
220,
220,
220,
220,
2361,
201,
201,
201,
2,
27354,
418,
435,
1248,
390,
317,
1671,
346,
201,
201,
201,
201,
201,
201,
201,
201,
1640,
6124,
78,
287,
6124,
418,
25,
201,
220,
220,
220,
1097,
7321,
2569,
64,
28,
34004,
78,
58,
15,
60,
201,
220,
220,
220,
5259,
43348,
28,
34004,
78,
58,
16,
60,
201,
220,
220,
220,
256,
28,
34004,
78,
58,
17,
60,
201,
220,
220,
220,
220,
201,
220,
220,
220,
220,
201,
220,
220,
220,
1303,
4852,
940,
28,
7568,
58,
7568,
13,
77,
2381,
260,
62,
36996,
0,
11639,
9171,
1773,
6212,
2271,
6,
7131,
17816,
77,
2381,
260,
62,
785,
9613,
3256,
7718,
7321,
2569,
64,
60,
4083,
30619,
62,
27160,
7,
7718,
7321,
2569,
64,
11,
3372,
1571,
28,
25101,
737,
2256,
7,
940,
8,
201,
220,
220,
220,
1353,
940,
28,
7568,
58,
17816,
77,
2381,
260,
62,
785,
9613,
3256,
7718,
7321,
2569,
64,
60,
4083,
30619,
62,
27160,
7,
7718,
7321,
2569,
64,
11,
3372,
1571,
28,
25101,
737,
2256,
7,
940,
8,
201,
220,
220,
220,
1353,
940,
28,
4852,
940,
13,
42503,
62,
9630,
7,
14781,
28,
17821,
8,
201,
220,
220,
220,
3601,
7,
4852,
940,
8,
201,
201,
220,
220,
220,
6340,
17167,
62,
305,
73,
418,
28,
17816,
445,
20520,
9,
940,
2,
82,
5907,
13,
8043,
62,
18596,
5857,
7203,
49,
5379,
1600,
940,
8,
2,
82,
5907,
13,
8043,
62,
18596,
5857,
7203,
65,
18351,
1600,
1120,
38381,
1821,
25,
1120,
60,
201,
220,
220,
220,
6340,
17167,
62,
332,
8906,
28,
17816,
27299,
20520,
9,
940,
2,
82,
5907,
13,
8043,
62,
18596,
5857,
7203,
38,
5681,
62,
81,
1600,
1238,
38381,
15,
25,
940,
60,
201,
220,
220,
220,
220,
201,
220,
220,
220,
220,
201,
220,
220,
220,
7872,
41888,
7,
13381,
14,
13381,
11,
2757,
14,
13381,
11,
657,
14,
13381,
15437,
9,
940,
201,
220,
220,
220,
6340,
17167,
62,
77,
19173,
73,
418,
28,
36022,
2,
17816,
36022,
20520,
9,
940,
2,
82,
5907,
13,
8043,
62,
18596,
5857,
7203,
5574,
6231,
62,
81,
1600,
1238,
38381,
15,
25,
940,
60,
201,
220,
220,
220,
220,
201,
220,
220,
220,
220,
201,
220,
220,
220,
6340,
17167,
28,
18596,
17167,
62,
332,
8906,
2,
17816,
14809,
20520,
9,
940,
1303,
82,
5907,
13,
8043,
62,
18596,
5857,
7203,
40078,
1600,
940,
8,
201,
220,
220,
220,
1312,
28,
15,
201,
220,
220,
220,
329,
20512,
287,
1353,
940,
13,
77,
2381,
260,
62,
785,
9613,
13,
45763,
7,
27399,
1580,
8107,
62,
23350,
2599,
201,
220,
220,
220,
220,
220,
220,
220,
611,
20512,
25,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6340,
17167,
58,
72,
22241,
18596,
17167,
62,
305,
73,
418,
58,
72,
60,
2,
6,
39532,
5549,
6,
201,
220,
220,
220,
220,
220,
220,
220,
1312,
47932,
16,
201,
220,
220,
220,
1312,
28,
15,
201,
220,
220,
220,
329,
20512,
287,
1353,
940,
13,
77,
2381,
260,
62,
785,
9613,
13,
45763,
7,
27399,
1580,
8107,
62,
1845,
2413,
2599,
201,
220,
220,
220,
220,
220,
220,
220,
611,
20512,
25,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6340,
17167,
58,
72,
22241,
18596,
17167,
62,
77,
19173,
73,
418,
58,
72,
60,
2,
6,
2971,
36022,
6,
201,
220,
220,
220,
220,
220,
220,
220,
1312,
47932,
16,
220,
220,
220,
220,
201,
220,
220,
220,
220,
201,
220,
220,
220,
220,
201,
220,
220,
220,
3013,
82,
13,
2617,
7,
10331,
62,
9888,
28,
17,
8,
201,
2,
220,
220,
220,
3013,
82,
13,
2617,
62,
7635,
7203,
83,
3378,
4943,
201,
220,
220,
220,
3013,
82,
13,
2617,
62,
7635,
7203,
11186,
25928,
4943,
201,
220,
220,
220,
435,
1462,
28,
1157,
201,
220,
220,
220,
281,
6679,
28,
23,
201,
220,
220,
220,
277,
11,
7877,
796,
458,
83,
13,
7266,
489,
1747,
7,
5647,
7857,
16193,
3702,
78,
11,
435,
1462,
4008,
201,
220,
220,
220,
220,
201,
220,
220,
220,
3013,
82,
13,
5657,
29487,
7,
87,
28,
7718,
7321,
2569,
64,
11,
331,
11639,
77,
2381,
260,
62,
785,
9613,
3256,
7890,
28,
4852,
940,
11,
18596,
5857,
28,
18596,
17167,
8,
201,
220,
220,
220,
220,
201,
220,
220,
220,
3013,
82,
13,
8906,
23908,
7,
9464,
28,
17821,
11,
4220,
28,
17821,
8,
201,
220,
220,
220,
1303,
897,
13,
2617,
62,
742,
624,
23912,
1424,
7,
4852,
940,
58,
7718,
7321,
2569,
64,
12962,
201,
220,
220,
220,
329,
279,
287,
7877,
13,
8071,
2052,
25,
201,
220,
220,
220,
220,
220,
220,
220,
7877,
13,
34574,
378,
7,
83,
4064,
279,
13,
1136,
62,
10394,
22784,
357,
79,
13,
1136,
62,
87,
3419,
1343,
279,
13,
1136,
62,
10394,
22784,
279,
13,
1136,
62,
88,
3419,
1343,
352,
13,
17,
828,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
88,
5239,
16193,
20,
11,
2319,
828,
2420,
1073,
3669,
11639,
28968,
2173,
11537,
201,
201,
220,
220,
220,
220,
220,
220,
220,
220,
201,
220,
220,
220,
458,
83,
13,
87,
18242,
7,
83,
270,
43348,
8,
201,
220,
220,
220,
458,
83,
13,
7839,
7203,
9126,
838,
955,
403,
292,
384,
70,
21356,
77,
43825,
83,
270,
43348,
1343,
435,
37,
3055,
64,
8,
201,
220,
220,
220,
458,
83,
13,
2645,
9608,
7,
7061,
8,
201,
220,
220,
220,
1303,
489,
83,
13,
20760,
3378,
7,
10599,
341,
28,
2231,
8,
201,
220,
220,
220,
458,
83,
13,
12860,
3419,
201,
220,
220,
220,
220,
201,
220,
220,
220,
458,
83,
13,
33464,
62,
39786,
3419,
201,
220,
220,
220,
220,
201,
220,
220,
220,
220,
201,
220,
220,
220,
220,
201,
220,
220,
220,
458,
83,
13,
21928,
5647,
10786,
521,
501,
62,
785,
403,
292,
6,
10,
7718,
7321,
2569,
64,
10,
4458,
11134,
11537,
201,
220,
220,
220,
220,
201,
220,
220,
220,
220,
201,
201,
2,
489,
83,
13,
26875,
7,
5647,
7857,
16193,
1065,
11,
23,
4008,
201,
2,
7110,
2318,
71,
8262,
351,
6376,
355,
2124,
3815,
201,
2,
897,
796,
3013,
82,
13,
5657,
29487,
7,
4852,
1314,
13,
9630,
11,
1353,
940,
13,
34004,
418,
62,
83,
313,
2040,
8,
201,
2,
897,
13,
1136,
62,
88,
22704,
22446,
2617,
62,
22478,
62,
687,
1436,
7,
489,
83,
13,
37,
19524,
8479,
1436,
7,
50033,
2124,
11,
1179,
25,
45144,
45299,
92,
1911,
18982,
7,
600,
7,
87,
35514,
201,
2,
897,
13,
2617,
7,
87,
18242,
2625,
29271,
1600,
331,
18242,
11639,
12332,
11537,
201,
2,
751,
1774,
14048,
3815,
355,
2124,
14722,
201,
2,
897,
13,
2617,
62,
742,
624,
23912,
1424,
7,
4852,
1314,
13,
77,
2381,
260,
62,
785,
9613,
8,
201,
2,
1640,
2378,
287,
7877,
13,
1136,
62,
742,
624,
23912,
1424,
33529,
2378,
13,
2617,
62,
10599,
341,
7,
3829,
8,
201,
2,
1640,
1312,
11,
410,
287,
27056,
378,
7,
4852,
1314,
14692,
77,
2381,
260,
62,
785,
9613,
1,
4083,
2676,
23814,
3419,
2599,
220,
220,
220,
220,
220,
220,
220,
220,
201,
2,
220,
220,
220,
7877,
13,
5239,
7,
72,
837,
85,
58,
16,
4357,
45144,
45299,
92,
1911,
18982,
7,
85,
58,
16,
46570,
3124,
11639,
76,
3256,
46935,
796,
6,
22487,
3256,
13179,
28,
2231,
8,
201,
2,
489,
83,
13,
33464,
62,
39786,
3419,
201,
2,
489,
83,
13,
12860,
3419,
201,
201,
201,
201,
201,
201,
201,
26224,
28,
47764,
58,
7568,
13,
47371,
855,
6,
8081,
72,
18840,
3395,
1773,
6212,
2271,
390,
34802,
20520,
201,
201,
46324,
62,
301,
2188,
62,
6978,
2625,
40720,
40720,
20942,
298,
274,
14,
46324,
62,
301,
2188,
14,
46324,
62,
301,
2188,
13,
40664,
1,
201,
2,
19608,
418,
62,
6978,
2625,
40720,
40720,
8220,
11008,
1129,
62,
1925,
576,
62,
5377,
403,
292,
12,
34004,
418,
62,
83,
313,
2040,
13,
7902,
53,
1,
201,
46324,
62,
301,
2188,
796,
279,
67,
13,
961,
62,
40664,
7,
46324,
62,
301,
2188,
62,
6978,
8,
201,
201,
201,
26224,
28,
26224,
13,
647,
469,
7,
46324,
62,
301,
2188,
11,
1364,
62,
261,
11639,
77,
2381,
260,
62,
785,
9613,
3256,
826,
62,
261,
11639,
77,
2381,
260,
62,
785,
9613,
3256,
3297,
11639,
25101,
11537,
201,
201,
201,
301,
2188,
28,
42721,
58,
26224,
13,
46324,
62,
301,
2188,
855,
16,
60,
201,
201,
2,
6779,
1619,
256,
1689,
31329,
390,
8591,
2336,
5330,
1619,
3975,
64,
201,
5647,
11,
7877,
796,
458,
83,
13,
7266,
489,
1747,
7,
5647,
7857,
16193,
1270,
11,
1542,
4008,
201,
2,
6779,
1619,
256,
8836,
83,
43348,
331,
22346,
304,
73,
274,
201,
897,
13,
2617,
62,
7839,
7,
84,
6,
5377,
403,
292,
1619,
17113,
34802,
16964,
6184,
235,
358,
501,
390,
371,
444,
2188,
390,
2345,
363,
952,
3256,
220,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14841,
796,
1160,
11,
220,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10369,
11600,
34758,
6,
10331,
7857,
10354,
1238,
11,
705,
8043,
10354,
705,
13424,
6,
30072,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
201,
2,
6779,
1619,
256,
8836,
83,
43348,
331,
22346,
304,
73,
274,
201,
2,
897,
13,
2617,
62,
87,
18242,
10786,
14617,
26331,
11537,
201,
2,
897,
13,
2617,
62,
2645,
9608,
10786,
24220,
26331,
11537,
201,
489,
83,
13,
22704,
10786,
2364,
11537,
201,
2,
897,
13,
1455,
437,
7,
10331,
7857,
28,
12825,
8,
201,
2,
317,
12654,
324,
343,
8591,
443,
88,
7438,
2880,
4763,
1619,
3975,
64,
201,
6738,
285,
489,
62,
25981,
74,
896,
13,
897,
274,
62,
25928,
16,
1330,
787,
62,
897,
274,
62,
17946,
21156,
201,
7146,
1304,
796,
787,
62,
897,
274,
62,
17946,
21156,
7,
897,
8,
201,
66,
897,
796,
2659,
1304,
13,
33295,
62,
897,
274,
7203,
3506,
1600,
2546,
2625,
20,
4,
1600,
14841,
28,
15,
13,
17,
8,
201,
2,
8899,
62,
2257,
11230,
58,
7,
8899,
62,
2257,
11230,
13,
45,
2662,
40438,
0,
11639,
50,
17096,
3839,
11537,
5,
7,
8899,
62,
2257,
11230,
13,
45,
2662,
40438,
0,
11639,
15946,
312,
29634,
11537,
5,
7,
8899,
62,
2257,
11230,
13,
45,
2662,
40438,
0,
11639,
127,
239,
84,
12654,
12162,
11537,
5,
7,
8899,
62,
2257,
11230,
13,
45,
2662,
40438,
0,
11639,
46898,
9724,
274,
11537,
60,
220,
201,
2,
4042,
20040,
1288,
3975,
64,
2457,
528,
4533,
201,
301,
2188,
13,
29487,
7,
28665,
11639,
1678,
2188,
3256,
220,
201,
220,
220,
220,
220,
220,
220,
220,
269,
8899,
11639,
49,
5379,
3256,
7877,
28,
897,
11,
201,
220,
220,
220,
220,
220,
220,
220,
8177,
28,
17821,
11,
201,
220,
220,
220,
220,
220,
220,
220,
8177,
62,
46265,
9310,
34758,
6,
18242,
10354,
366,
49,
444,
2188,
390,
2345,
363,
952,
25719,
201,
220,
220,
220,
220,
220,
220,
220,
269,
897,
28,
66,
897,
11,
1976,
2875,
28,
20,
11,
2,
201,
220,
220,
220,
220,
220,
220,
220,
4814,
62,
46265,
9310,
28,
4895,
8043,
1298,
366,
2971,
49502,
1600,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
14907,
8043,
1298,
366,
13424,
1600,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
71,
963,
1298,
366,
20379,
1,
201,
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,
220,
220,
220,
220,
220,
220,
220,
1303,
1,
18242,
1298,
366,
43730,
3815,
1600,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32092,
201,
201,
5647,
11,
7877,
796,
458,
83,
13,
7266,
489,
1747,
7,
5647,
7857,
16193,
1270,
11,
1542,
4008,
201,
7061,
6,
201,
301,
2188,
13,
29487,
7,
28665,
11639,
1678,
2188,
3256,
66,
8899,
11639,
49,
5379,
3256,
7877,
28,
897,
11,
201,
220,
220,
220,
220,
220,
220,
220,
8177,
28,
17821,
1455,
437,
62,
46265,
9310,
34758,
6,
18242,
10354,
366,
49,
444,
2188,
390,
2345,
363,
952,
25719,
201,
220,
220,
220,
220,
220,
220,
220,
269,
897,
28,
66,
897,
11,
1976,
2875,
28,
20,
11,
201,
220,
220,
220,
220,
220,
220,
220,
4814,
62,
46265,
9310,
28,
4895,
8043,
1298,
366,
2971,
49502,
1600,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
14907,
8043,
1298,
366,
13424,
1600,
201,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
71,
963,
1298,
366,
20379,
1,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32092,
2,
11,
201,
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,
220,
220,
220,
220,
220,
220,
220,
1303,
1,
18242,
1298,
366,
43730,
3815,
1600,
30072,
201,
7061,
6,
201,
201,
201
] | 2.039841 | 5,045 |
#!/usr/bin/env python
#
# Copyright (c) 2019, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# - Neither the name of Arista Networks nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Locate last Snapshot with user provided name for CVP 2018.1.x
#
# Version 0.1 22/01/2019
#
# Written by:
# Hugh Adams, Arista Networks
#
# Revision history:
# 0.1 - 22/01/2019 - initial script
#
# Requires a user with read access to "Snapshots" in CVP
# Requires a snapshot to be created with the following commands
# show inventory | json
# show lldp neighbors | json
#
# Requires CVP user credentials
#
# Import Required Libraries
import json
import re
import os, csv
import argparse
import getpass
import sys
import json
import requests
from requests import packages
from time import sleep
# Global Variables
# CVP manipulation class
# Set up classes to interact with CVP API
# serverCVP exception class
# Create a session to the CVP server
def fileOpen(filePath,fileType):
""" filePath - full directory and filename for file
function returns file contents based on selection
json - JSON object
txt - text string
csv - Comma Separated Variable
j2 - Jinja2 Template object"""
if os.path.exists(filePath) and os.path.getsize(filePath) > 0:
print "Retrieving file:%s" %filePath
if fileType.lower() == "xl":
fileObject = xlrd.open_workbook(filePath)
else:
with open(filePath, 'r') as FH:
if fileType.lower() == "json":
fileObject = json.load(FH)
elif fileType.lower() == "txt":
fileObject = FH.readlines()
elif fileType.lower() == "csv":
file_data = csv.reader(FH)
fileObject = output = list(file_data)
elif fileType.lower() == "j2":
fileObject = Template(FH.read())
else:
print "Invalid fileType"
fileObject = False
return fileObject
else:
print "File does not exist or is empty: %s" %filePath
return False
def fileWrite(filePath,data,fileType,option="c"):
""" filePath - full directory and filename for file
Function returns True is file is successfully written to media
data - content to write to file
fileType
json - JSON object
txt - text string
csv - Comman Separated Variable string
option
a - append
w - overwrite
c - choose option based on file existance
"""
if option.lower() == "c":
if os.path.exists(filePath) and os.path.getsize(filePath) > 0:
print "Appending data to file:%s" %filePath
fileOp = "a"
else:
print "Creating file %s to write data to" %filePath
fileOp = "w"
else:
fileOp = option.lower()
try:
with open(filePath, fileOp) as FH:
if fileOp == "a":
FH.seek(0, 2)
if fileType.lower() == "json":
#json.dump(json.loads(data), FH, sort_keys = True, indent = 4, ensure_ascii = True)
json.dump(data, FH, sort_keys = True, indent = 4, ensure_ascii = True)
result = True
elif fileType.lower() == "txt":
FH.writelines(data)
result = True
elif fileType.lower() == "csv":
#write_csv = csv.writer(FH, dialect='excel')
write_csv = csv.writer(FH)
write_csv.writerows(data)
result = True
else:
print "Invalid fileType"
result = False
except IOError as file_error:
print "File Write Error: %s"%file_error
result = False
return result
def parseArgs():
"""Gathers comand line options for the script, generates help text and performs some error checking"""
# Configure the option parser for CLI options to the script
usage = "usage: %prog [options] userName password configlet xlfile"
parser = argparse.ArgumentParser(description="Excel File to JSON Configlet Builder")
parser.add_argument("--userName", help='Username to log into CVP')
parser.add_argument("--password", help='Password for CVP user to login')
parser.add_argument("--target", nargs="*", metavar='TARGET', default=[],
help='List of CVP appliances to get snapshot from URL,URL')
parser.add_argument("--snapshot", help='CVP Snapshot name containing required data')
parser.add_argument("--last", default="True", help="True - Only get latest snapshot for each device")
args = parser.parse_args()
return checkArgs( args )
def askPass( user, host ):
"""Simple function to get missing password if not recieved as a CLI option"""
prompt = "Password for user {} on host {}: ".format( user, host )
password = getpass.getpass( prompt )
return password
def checkArgs( args ):
"""check the correctness of the input arguments"""
# Set Intial Variables required
getCvpAccess = False
destList = []
# React to the options provided
# CVP Username for script to use
if args.userName == None:
getCvpAccess = True
# CVP Password for script to use
if args.password == None:
getCvpAccess = True
else:
if (args.password[0] == args.password[-1]) and args.password.startswith(("'", '"')):
password = args.password[1:-1]
if getCvpAccess:
args.userName = raw_input("User Name to Access CVP: ")
args.password = askPass( args.userName, "CVP" )
# CVP appliances to get snapsots from
if not args.target:
applianceNumber = int(raw_input("Number of CVP Appliance to use: "))
loop = 0
while loop < applianceNumber:
args.target.append(raw_input("CVP Appliance %s: " %(loop+1)))
loop += 1
# Target snapshot
if args.snapshot == None:
args.snapshot = raw_input("Name of Snapshot to retrieve: ")
else:
if (args.snapshot[0] == args.snapshot[-1]) and args.snapshot.startswith(("'", '"')):
args.snapshot = args.snapshot[1:-1]
# Get Last Snapshot
if args.last.lower() == "true":
args.last = True
else:
args.last = False
return args
# Main Script
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
357,
66,
8,
13130,
11,
943,
12523,
27862,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
1231,
198,
2,
17613,
11,
389,
10431,
2810,
326,
262,
1708,
3403,
389,
198,
2,
1138,
25,
198,
2,
220,
532,
2297,
396,
2455,
507,
286,
2723,
2438,
1276,
12377,
262,
2029,
6634,
4003,
11,
198,
2,
428,
1351,
286,
3403,
290,
262,
1708,
37592,
13,
198,
2,
220,
532,
2297,
396,
2455,
507,
287,
13934,
1296,
1276,
22919,
262,
2029,
6634,
198,
2,
4003,
11,
428,
1351,
286,
3403,
290,
262,
1708,
37592,
287,
262,
198,
2,
10314,
290,
14,
273,
584,
5696,
2810,
351,
262,
6082,
13,
198,
2,
220,
532,
16126,
262,
1438,
286,
943,
12523,
27862,
4249,
262,
3891,
286,
663,
198,
2,
20420,
743,
307,
973,
284,
11438,
393,
7719,
3186,
10944,
422,
198,
2,
428,
3788,
1231,
2176,
3161,
3194,
7170,
13,
198,
2,
198,
2,
12680,
47466,
3180,
36592,
2389,
1961,
11050,
3336,
27975,
38162,
9947,
367,
15173,
4877,
5357,
27342,
9865,
3843,
20673,
198,
2,
366,
1921,
3180,
1,
5357,
15529,
7788,
32761,
6375,
8959,
49094,
34764,
11015,
11,
47783,
2751,
11,
21728,
5626,
40880,
198,
2,
5390,
11,
3336,
8959,
49094,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
5357,
376,
46144,
7473,
317,
16652,
2149,
37232,
198,
2,
33079,
48933,
15986,
13954,
48778,
1961,
13,
3268,
8005,
49261,
50163,
3336,
27975,
38162,
9947,
49707,
14418,
6375,
27342,
9865,
3843,
20673,
198,
2,
9348,
43031,
19146,
7473,
15529,
42242,
11,
3268,
17931,
23988,
11,
19387,
25256,
1847,
11,
38846,
11,
7788,
3620,
6489,
13153,
11,
6375,
198,
2,
7102,
5188,
10917,
3525,
12576,
29506,
25552,
357,
1268,
39149,
2751,
11,
21728,
5626,
40880,
5390,
11,
41755,
11335,
10979,
3963,
28932,
2257,
2043,
37780,
198,
2,
21090,
50,
6375,
49254,
26,
406,
18420,
3963,
23210,
11,
42865,
11,
6375,
4810,
19238,
29722,
26,
6375,
43949,
44180,
23255,
49,
8577,
24131,
8,
198,
2,
29630,
36,
5959,
7257,
2937,
1961,
5357,
6177,
15529,
3336,
15513,
3963,
43031,
25382,
11,
7655,
2767,
16879,
3268,
27342,
10659,
11,
19269,
18379,
198,
2,
43031,
25382,
11,
6375,
309,
9863,
357,
1268,
39149,
2751,
399,
7156,
43,
3528,
18310,
6375,
25401,
54,
24352,
8,
5923,
1797,
2751,
3268,
15529,
34882,
16289,
3963,
198,
2,
3336,
23210,
3963,
12680,
47466,
11,
45886,
16876,
5984,
29817,
1961,
3963,
3336,
28069,
11584,
25382,
3963,
13558,
3398,
29506,
11879,
13,
198,
2,
198,
2,
406,
13369,
938,
16026,
9442,
351,
2836,
2810,
1438,
329,
327,
8859,
2864,
13,
16,
13,
87,
198,
2,
198,
2,
220,
220,
220,
10628,
657,
13,
16,
2534,
14,
486,
14,
23344,
198,
2,
198,
2,
220,
220,
220,
22503,
416,
25,
198,
2,
220,
220,
220,
220,
220,
220,
25464,
12620,
11,
943,
12523,
27862,
198,
2,
198,
2,
220,
220,
220,
46604,
2106,
25,
198,
2,
220,
220,
220,
220,
220,
220,
657,
13,
16,
532,
2534,
14,
486,
14,
23344,
532,
4238,
4226,
198,
2,
198,
2,
26848,
257,
2836,
351,
1100,
1895,
284,
366,
43826,
20910,
1,
287,
327,
8859,
198,
2,
26848,
257,
27479,
284,
307,
2727,
351,
262,
1708,
9729,
198,
2,
905,
13184,
930,
33918,
198,
2,
905,
32660,
26059,
12020,
930,
33918,
198,
2,
198,
2,
26848,
327,
8859,
2836,
18031,
198,
2,
198,
198,
2,
17267,
20906,
46267,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
28686,
11,
269,
21370,
198,
11748,
1822,
29572,
198,
11748,
651,
6603,
198,
11748,
25064,
198,
11748,
33918,
198,
11748,
7007,
198,
6738,
7007,
1330,
10392,
198,
6738,
640,
1330,
3993,
198,
198,
2,
8060,
15965,
2977,
198,
198,
2,
327,
8859,
17512,
1398,
198,
2,
5345,
510,
6097,
284,
9427,
351,
327,
8859,
7824,
198,
2,
4382,
34,
8859,
6631,
1398,
198,
198,
2,
13610,
257,
6246,
284,
262,
327,
8859,
4382,
628,
198,
4299,
2393,
11505,
7,
7753,
15235,
11,
7753,
6030,
2599,
198,
220,
220,
220,
37227,
2393,
15235,
532,
1336,
8619,
290,
29472,
329,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
2163,
5860,
2393,
10154,
1912,
319,
6356,
198,
220,
220,
220,
220,
220,
220,
220,
33918,
532,
19449,
2134,
198,
220,
220,
220,
220,
220,
220,
220,
256,
742,
532,
2420,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
269,
21370,
532,
1520,
64,
8621,
283,
515,
35748,
198,
220,
220,
220,
220,
220,
220,
220,
474,
17,
532,
17297,
6592,
17,
37350,
2134,
37811,
198,
220,
220,
220,
611,
28686,
13,
6978,
13,
1069,
1023,
7,
7753,
15235,
8,
290,
28686,
13,
6978,
13,
11407,
1096,
7,
7753,
15235,
8,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
366,
9781,
37418,
2393,
25,
4,
82,
1,
4064,
7753,
15235,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2393,
6030,
13,
21037,
3419,
6624,
366,
87,
75,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
10267,
796,
2124,
75,
4372,
13,
9654,
62,
1818,
2070,
7,
7753,
15235,
8,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
7753,
15235,
11,
705,
81,
11537,
355,
376,
39,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2393,
6030,
13,
21037,
3419,
6624,
366,
17752,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
10267,
796,
33918,
13,
2220,
7,
44602,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2393,
6030,
13,
21037,
3419,
6624,
366,
14116,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
10267,
796,
376,
39,
13,
961,
6615,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2393,
6030,
13,
21037,
3419,
6624,
366,
40664,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
62,
7890,
796,
269,
21370,
13,
46862,
7,
44602,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
10267,
796,
5072,
796,
1351,
7,
7753,
62,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2393,
6030,
13,
21037,
3419,
6624,
366,
73,
17,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
10267,
796,
37350,
7,
44602,
13,
961,
28955,
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,
3601,
366,
44651,
2393,
6030,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
10267,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2393,
10267,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
366,
8979,
857,
407,
2152,
393,
318,
6565,
25,
4064,
82,
1,
4064,
7753,
15235,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
198,
4299,
2393,
16594,
7,
7753,
15235,
11,
7890,
11,
7753,
6030,
11,
18076,
2625,
66,
1,
2599,
198,
220,
220,
220,
37227,
2393,
15235,
532,
1336,
8619,
290,
29472,
329,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
15553,
5860,
6407,
318,
2393,
318,
7675,
3194,
284,
2056,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
532,
2695,
284,
3551,
284,
2393,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
6030,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33918,
532,
19449,
2134,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
742,
532,
2420,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
21370,
532,
955,
805,
8621,
283,
515,
35748,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
3038,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
257,
532,
24443,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
266,
532,
49312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
532,
3853,
3038,
1912,
319,
2393,
2152,
590,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
3038,
13,
21037,
3419,
6624,
366,
66,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
611,
28686,
13,
6978,
13,
1069,
1023,
7,
7753,
15235,
8,
290,
28686,
13,
6978,
13,
11407,
1096,
7,
7753,
15235,
8,
1875,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
366,
4677,
1571,
1366,
284,
2393,
25,
4,
82,
1,
4064,
7753,
15235,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
18257,
796,
366,
64,
1,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
366,
32071,
2393,
4064,
82,
284,
3551,
1366,
284,
1,
4064,
7753,
15235,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2393,
18257,
796,
366,
86,
1,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2393,
18257,
796,
3038,
13,
21037,
3419,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
351,
1280,
7,
7753,
15235,
11,
2393,
18257,
8,
355,
376,
39,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2393,
18257,
6624,
366,
64,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
376,
39,
13,
36163,
7,
15,
11,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2393,
6030,
13,
21037,
3419,
6624,
366,
17752,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
17752,
13,
39455,
7,
17752,
13,
46030,
7,
7890,
828,
376,
39,
11,
3297,
62,
13083,
796,
6407,
11,
33793,
796,
604,
11,
4155,
62,
292,
979,
72,
796,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33918,
13,
39455,
7,
7890,
11,
376,
39,
11,
3297,
62,
13083,
796,
6407,
11,
33793,
796,
604,
11,
4155,
62,
292,
979,
72,
796,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2393,
6030,
13,
21037,
3419,
6624,
366,
14116,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
376,
39,
13,
8933,
20655,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2393,
6030,
13,
21037,
3419,
6624,
366,
40664,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
13564,
62,
40664,
796,
269,
21370,
13,
16002,
7,
44602,
11,
23637,
11639,
1069,
5276,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
62,
40664,
796,
269,
21370,
13,
16002,
7,
44602,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3551,
62,
40664,
13,
16002,
1666,
7,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
6407,
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,
3601,
366,
44651,
2393,
6030,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
10352,
198,
220,
220,
220,
2845,
24418,
12331,
355,
2393,
62,
18224,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
366,
8979,
19430,
13047,
25,
4064,
82,
1,
4,
7753,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
10352,
198,
220,
220,
220,
1441,
1255,
198,
198,
4299,
21136,
42035,
33529,
198,
220,
220,
220,
37227,
38,
1032,
82,
401,
392,
1627,
3689,
329,
262,
4226,
11,
18616,
1037,
2420,
290,
17706,
617,
4049,
10627,
37811,
198,
220,
220,
220,
1303,
17056,
495,
262,
3038,
30751,
329,
43749,
3689,
284,
262,
4226,
198,
220,
220,
220,
8748,
796,
366,
26060,
25,
4064,
1676,
70,
685,
25811,
60,
2836,
5376,
9206,
4566,
1616,
2124,
1652,
576,
1,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
2625,
3109,
5276,
9220,
284,
19449,
17056,
1616,
35869,
4943,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
438,
7220,
5376,
1600,
1037,
11639,
5842,
13292,
284,
2604,
656,
327,
8859,
11537,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
438,
28712,
1600,
1037,
11639,
35215,
329,
327,
8859,
2836,
284,
17594,
11537,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
438,
16793,
1600,
299,
22046,
2625,
9,
1600,
1138,
615,
283,
11639,
51,
46095,
3256,
4277,
41888,
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,
1037,
11639,
8053,
286,
327,
8859,
29834,
284,
651,
27479,
422,
10289,
11,
21886,
11537,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
438,
45380,
9442,
1600,
1037,
11639,
34,
8859,
16026,
9442,
1438,
7268,
2672,
1366,
11537,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
438,
12957,
1600,
4277,
2625,
17821,
1600,
1037,
2625,
17821,
532,
5514,
651,
3452,
27479,
329,
1123,
3335,
4943,
198,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
198,
220,
220,
220,
1441,
2198,
42035,
7,
26498,
1267,
198,
198,
4299,
1265,
14478,
7,
2836,
11,
2583,
15179,
198,
220,
220,
220,
37227,
26437,
2163,
284,
651,
4814,
9206,
611,
407,
664,
39591,
355,
257,
43749,
3038,
37811,
198,
220,
220,
220,
6152,
796,
366,
35215,
329,
2836,
23884,
319,
2583,
23884,
25,
27071,
18982,
7,
2836,
11,
2583,
1267,
198,
220,
220,
220,
9206,
796,
651,
6603,
13,
1136,
6603,
7,
6152,
1267,
198,
220,
220,
220,
1441,
9206,
198,
198,
4299,
2198,
42035,
7,
26498,
15179,
198,
220,
220,
220,
37227,
9122,
262,
29409,
286,
262,
5128,
7159,
37811,
198,
220,
220,
220,
1303,
5345,
2558,
498,
15965,
2977,
2672,
198,
220,
220,
220,
651,
34,
36133,
15457,
796,
10352,
198,
220,
220,
220,
2244,
8053,
796,
17635,
628,
220,
220,
220,
1303,
21492,
284,
262,
3689,
2810,
628,
220,
220,
220,
1303,
327,
8859,
50069,
329,
4226,
284,
779,
198,
220,
220,
220,
611,
26498,
13,
7220,
5376,
6624,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
651,
34,
36133,
15457,
796,
6407,
628,
220,
220,
220,
1303,
327,
8859,
30275,
329,
4226,
284,
779,
198,
220,
220,
220,
611,
26498,
13,
28712,
6624,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
651,
34,
36133,
15457,
796,
6407,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
22046,
13,
28712,
58,
15,
60,
6624,
26498,
13,
28712,
58,
12,
16,
12962,
290,
26498,
13,
28712,
13,
9688,
2032,
342,
7,
7203,
6,
1600,
705,
1,
11537,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9206,
796,
26498,
13,
28712,
58,
16,
21912,
16,
60,
628,
220,
220,
220,
611,
651,
34,
36133,
15457,
25,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
7220,
5376,
796,
8246,
62,
15414,
7203,
12982,
6530,
284,
8798,
327,
8859,
25,
366,
8,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
28712,
796,
1265,
14478,
7,
26498,
13,
7220,
5376,
11,
366,
34,
8859,
1,
1267,
628,
220,
220,
220,
1303,
327,
8859,
29834,
284,
651,
23429,
1747,
422,
198,
220,
220,
220,
611,
407,
26498,
13,
16793,
25,
198,
220,
220,
220,
220,
220,
220,
220,
45248,
15057,
796,
493,
7,
1831,
62,
15414,
7203,
15057,
286,
327,
8859,
39100,
3610,
284,
779,
25,
366,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
9052,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
981,
9052,
1279,
45248,
15057,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
16793,
13,
33295,
7,
1831,
62,
15414,
7203,
34,
8859,
39100,
3610,
4064,
82,
25,
366,
4064,
7,
26268,
10,
16,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9052,
15853,
352,
628,
220,
220,
220,
1303,
12744,
27479,
198,
220,
220,
220,
611,
26498,
13,
45380,
9442,
6624,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
45380,
9442,
796,
8246,
62,
15414,
7203,
5376,
286,
16026,
9442,
284,
19818,
25,
366,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
357,
22046,
13,
45380,
9442,
58,
15,
60,
6624,
26498,
13,
45380,
9442,
58,
12,
16,
12962,
290,
26498,
13,
45380,
9442,
13,
9688,
2032,
342,
7,
7203,
6,
1600,
705,
1,
11537,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
45380,
9442,
796,
26498,
13,
45380,
9442,
58,
16,
21912,
16,
60,
628,
220,
220,
220,
1303,
3497,
4586,
16026,
9442,
198,
220,
220,
220,
611,
26498,
13,
12957,
13,
21037,
3419,
6624,
366,
7942,
1298,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
12957,
796,
6407,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
12957,
796,
10352,
628,
220,
220,
220,
1441,
26498,
628,
198,
2,
8774,
12327,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.549626 | 3,073 |
# Space: O(1)
# Time: O(n)
| [
198,
2,
4687,
25,
440,
7,
16,
8,
198,
2,
3862,
25,
440,
7,
77,
8,
628,
628,
198
] | 1.684211 | 19 |
#!/usr/bin/env python
import rospy
from mavros_msgs.msg import PositionTarget
from geometry_msgs.msg import PoseStamped
from std_msgs.msg import Float32, String, Bool
if __name__ == '__main__':
rospy.init_node('checker_1')
server = Server()
rospy.Subscriber("/uav1/mavros/local_position/pose", PoseStamped , server.curpos_callback)
rospy.Subscriber("/uav1/mavros/setpoint_raw/local", PositionTarget, server.targetwp_callback)
rospy.spin()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
686,
2777,
88,
198,
6738,
285,
615,
4951,
62,
907,
14542,
13,
19662,
1330,
23158,
21745,
198,
6738,
22939,
62,
907,
14542,
13,
19662,
1330,
37557,
1273,
13322,
198,
6738,
14367,
62,
907,
14542,
13,
19662,
1330,
48436,
2624,
11,
10903,
11,
347,
970,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
686,
2777,
88,
13,
15003,
62,
17440,
10786,
9122,
263,
62,
16,
11537,
628,
220,
220,
220,
4382,
796,
9652,
3419,
628,
220,
220,
220,
686,
2777,
88,
13,
7004,
1416,
24735,
7203,
14,
84,
615,
16,
14,
76,
615,
4951,
14,
12001,
62,
9150,
14,
3455,
1600,
37557,
1273,
13322,
837,
4382,
13,
22019,
1930,
62,
47423,
8,
198,
220,
220,
220,
686,
2777,
88,
13,
7004,
1416,
24735,
7203,
14,
84,
615,
16,
14,
76,
615,
4951,
14,
2617,
4122,
62,
1831,
14,
12001,
1600,
23158,
21745,
11,
4382,
13,
16793,
24142,
62,
47423,
8,
628,
220,
220,
220,
686,
2777,
88,
13,
39706,
3419,
198
] | 2.606742 | 178 |
"""Models!"""
from pathlib import Path
import re
import glob
from django.db import models
from django.urls import reverse
from gbt_archive.utils import get_archive_path
class History(models.Model):
"""Stores history of CSV exports, intended for AAT consumption"""
historyid = models.AutoField(db_column="historyID", primary_key=True)
archivaldate = models.DateField(db_column="archivalDate")
aatfilename = models.CharField(db_column="aatFilename", max_length=256)
version = models.CharField(max_length=12)
# class TestOfflineOld(models.Model):
# errorid = models.AutoField(db_column="errorID", primary_key=True)
# errormsg = models.CharField(db_column="errorMsg", max_length=64)
# severity = models.IntegerField()
# class Meta:
# managed = False
# db_table = "test_offline_old"
| [
37811,
5841,
1424,
2474,
15931,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
302,
198,
11748,
15095,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
308,
18347,
62,
17474,
13,
26791,
1330,
651,
62,
17474,
62,
6978,
628,
628,
198,
198,
4871,
7443,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
37227,
1273,
2850,
2106,
286,
44189,
15319,
11,
5292,
329,
317,
1404,
7327,
37811,
628,
220,
220,
220,
2106,
312,
796,
4981,
13,
27722,
15878,
7,
9945,
62,
28665,
2625,
23569,
2389,
1600,
4165,
62,
2539,
28,
17821,
8,
198,
220,
220,
220,
3934,
452,
1940,
378,
796,
4981,
13,
10430,
15878,
7,
9945,
62,
28665,
2625,
998,
2473,
10430,
4943,
198,
220,
220,
220,
257,
265,
34345,
796,
4981,
13,
12441,
15878,
7,
9945,
62,
28665,
2625,
64,
265,
35063,
1600,
3509,
62,
13664,
28,
11645,
8,
198,
220,
220,
220,
2196,
796,
4981,
13,
12441,
15878,
7,
9806,
62,
13664,
28,
1065,
8,
628,
628,
628,
198,
2,
1398,
6208,
28657,
19620,
7,
27530,
13,
17633,
2599,
198,
2,
220,
220,
220,
220,
4049,
312,
796,
4981,
13,
27722,
15878,
7,
9945,
62,
28665,
2625,
18224,
2389,
1600,
4165,
62,
2539,
28,
17821,
8,
198,
2,
220,
220,
220,
220,
11454,
579,
45213,
796,
4981,
13,
12441,
15878,
7,
9945,
62,
28665,
2625,
18224,
50108,
1600,
3509,
62,
13664,
28,
2414,
8,
198,
2,
220,
220,
220,
220,
19440,
796,
4981,
13,
46541,
15878,
3419,
198,
198,
2,
220,
220,
220,
220,
1398,
30277,
25,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
5257,
796,
10352,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
11487,
796,
366,
9288,
62,
2364,
1370,
62,
727,
1,
198
] | 2.83557 | 298 |
from talon import ctrl, noise, actions
noise.register(
"pop",
lambda m: ctrl.mouse_click()
if actions.speech.enabled()
else actions.speech.enable(),
)
| [
6738,
3305,
261,
1330,
269,
14859,
11,
7838,
11,
4028,
198,
198,
3919,
786,
13,
30238,
7,
198,
220,
220,
220,
366,
12924,
1600,
198,
220,
220,
220,
37456,
285,
25,
269,
14859,
13,
35888,
62,
12976,
3419,
198,
220,
220,
220,
611,
4028,
13,
45862,
13,
25616,
3419,
198,
220,
220,
220,
2073,
4028,
13,
45862,
13,
21633,
22784,
198,
8,
198
] | 2.666667 | 63 |
from PIL import Image
from io import BytesIO
from base64 import b64decode
import numpy
import re
import cv2
import random
from collections import namedtuple
from math import hypot
if cv2.__version__.split()[0] == '3':
old_find_contours = cv2.findContours
cv2.findContours = new_find_contours
RotatedRect = namedtuple("RotatedRect", "center, size, angle")
DEFAULT_SIZE = (40, 50)
def read_base64(data_url):
"Read and binarize an image from data_url."
image_str = re.fullmatch("data:image/jpg;base64,(.+)", data_url).group(1)
pil_image = Image.open(BytesIO(b64decode(image_str)))
raw_image = ~cv2.cvtColor(numpy.array(pil_image), cv2.COLOR_RGB2GRAY)
_, binary_image = cv2.threshold(raw_image, 10, 255, cv2.THRESH_BINARY)
return binary_image
def get_angle(rrect):
"Get the nearest angle to make the rectangle up-right."
return rrect.angle if rrect.angle > -45 else 90 + rrect.angle
def findContours(image):
"Work around the difference between opencv 3 and opencv 4."
return cv2.findContours(image, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)[-2]
def find_chars(image):
"Find the characters in image, return them as rotated rectangles."
contours = findContours(image)
# print(contours)
rrects = [RotatedRect(*cv2.minAreaRect(c)) for c in contours]
if len(contours) != 4: # i and j
if len(contours) < 4: # some lost character
raise CharacterTooComplicated()
dot_indices = filter(
lambda i: get_area(rrects[i]) < 40, range(len(rrects)))
body_indices = list(filter(
lambda i: get_area(rrects[i]) >= 40, range(len(rrects))))
if len(body_indices) != 4:
raise CharacterTooComplicated()
for di in dot_indices:
nearest = min(body_indices, key=get_distance)
# print(nearest)
joined_contour = numpy.concatenate(
(contours[di], contours[nearest]))
rrects[nearest] = RotatedRect(*cv2.minAreaRect(joined_contour))
rrects = [rrects[i] for i in body_indices]
return rrects
def crop_rrect(image, rrect, margin):
"Crop a rotated rectangle from image."
mat = cv2.getRotationMatrix2D(rrect.center, get_angle(rrect), 1)
size = int(rrect.size[0]+margin*2), int(rrect.size[1]+margin*2)
if rrect.angle <= -45:
size = size[1], size[0]
for i in (0, 1):
mat[i, 2] += size[i] / 2 - rrect.center[i]
dst = cv2.warpAffine(image, mat, size, cv2.INTER_LINEAR)
# print(get_angle(rrect), size, rrect)
return dst
def isolate_chars(image, margin=0):
"Find the characters in the image, return them as images."
rrects = sorted(find_chars(image), key=lambda rrect: rrect.center)
cropped = [crop_rrect(image, rrect, margin) for rrect in rrects]
return cropped
def concat_chars(chars, size=DEFAULT_SIZE):
"Concatenate the characters to form a whole picture for use in tesseract."
canvas = numpy.zeros((size[1], size[0]*4), numpy.uint8)
for i in range(4):
char_size = chars[i].shape
high = (size[1]+char_size[0])//2, (size[0]+char_size[1])//2
low = high[0]-char_size[0], high[1]-char_size[1]
canvas[
low[0]: high[0],
size[0]*i + low[1]: size[0]*i + high[1],
] = chars[i]
return canvas
if __name__ == "__main__":
image_url = "data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABFCAIAAACAFD7PAAACKUlEQVR42u3bwU3EMBBG4ZRDF9sHlVABEjTCgTqohTICp2iVaLP22DP/2HlPuREJKfmYxN5lWYkcWrgEBCwCFgGLCFgELAIWEbBS9/L+w0UAVmdS28HVAFZnUsACliMsbAGLoQUshhawsAUsYmhJYX1/vm7HBdFgKwJWCa85CFYRAZY7rOPJwzmzEcGWI6wJVJmJAMsL1hyqsJUL1kyqWogAqyesyVQxtFLDmmlVyNASwBKq+vh6Y2jNCUs7q/5hbUfyrQftzf693XZHaljyJ+A9LCdeow+tIylvXnZYeV7YA2ANPbTOVTnxaoKVZBmogmUbWjlVdbe12FSdwIr/iyyE1c6ui620qrLAyrNrVQKry1QbC9ZTOq62LgHreEKkrTywIteJ/WElfMfqpcoAS/iOVYgGWEZYHVXV2hJuN5SPopFg5dlu6K6qXIx2E6v2GZcO1vneqRaWk6pHaJ4e2vVg8GOkCVbhT4NheY8rmy359tUwsGpPCIblqqrWVvxKeWZYkd9u2OkJUFVua1U0Dyzh0CqB5ffbs5G6BKwYW4/2PwNUpa12dzQ1LJUtYNlsZfys0LZ4lMBar5rwE+hSWO3/qqqCtV67qWDFv8Wjqt2W7B1r56YWlqstYDXaUq4KbQlh4amEl367IXOoStiCKgIWmwvAUqgCFrAYV8AaBBb3ElhsLgArtzDuH7AIWETAImARsIiARcAiYBEBi4BFwCICFgGLgEVk6g+FZO0jKAvv3AAAAABJRU5ErkJggg=="
image = read_base64(image_url)
cv2.imshow("src", image)
chars = isolate_chars(image)
for i in range(4):
cv2.imshow(f"character {i}", chars[i])
concat = concat_chars(chars)
cv2.imshow("concat", concat)
# cv2.imwrite("c.png", ~concat)
cv2.waitKey()
| [
6738,
350,
4146,
1330,
7412,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
6738,
2779,
2414,
1330,
275,
2414,
12501,
1098,
198,
11748,
299,
32152,
198,
11748,
302,
198,
11748,
269,
85,
17,
198,
11748,
4738,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
10688,
1330,
8813,
628,
198,
361,
269,
85,
17,
13,
834,
9641,
834,
13,
35312,
3419,
58,
15,
60,
6624,
705,
18,
10354,
198,
220,
220,
220,
1468,
62,
19796,
62,
3642,
4662,
796,
269,
85,
17,
13,
19796,
4264,
4662,
198,
220,
220,
220,
269,
85,
17,
13,
19796,
4264,
4662,
796,
649,
62,
19796,
62,
3642,
4662,
628,
198,
198,
24864,
515,
45474,
796,
3706,
83,
29291,
7203,
24864,
515,
45474,
1600,
366,
16159,
11,
2546,
11,
9848,
4943,
628,
198,
7206,
38865,
62,
33489,
796,
357,
1821,
11,
2026,
8,
628,
198,
4299,
1100,
62,
8692,
2414,
7,
7890,
62,
6371,
2599,
198,
220,
220,
220,
366,
5569,
290,
9874,
283,
1096,
281,
2939,
422,
1366,
62,
6371,
526,
198,
220,
220,
220,
2939,
62,
2536,
796,
302,
13,
12853,
15699,
7203,
7890,
25,
9060,
14,
9479,
26,
8692,
2414,
11,
7,
13,
28988,
1600,
1366,
62,
6371,
737,
8094,
7,
16,
8,
198,
220,
220,
220,
5560,
62,
9060,
796,
7412,
13,
9654,
7,
45992,
9399,
7,
65,
2414,
12501,
1098,
7,
9060,
62,
2536,
22305,
198,
220,
220,
220,
8246,
62,
9060,
796,
5299,
33967,
17,
13,
33967,
83,
10258,
7,
77,
32152,
13,
18747,
7,
79,
346,
62,
9060,
828,
269,
85,
17,
13,
46786,
62,
36982,
17,
38,
30631,
8,
198,
220,
220,
220,
4808,
11,
13934,
62,
9060,
796,
269,
85,
17,
13,
400,
10126,
7,
1831,
62,
9060,
11,
838,
11,
14280,
11,
269,
85,
17,
13,
4221,
19535,
39,
62,
33,
1268,
13153,
8,
198,
220,
220,
220,
1441,
13934,
62,
9060,
628,
198,
198,
4299,
651,
62,
9248,
7,
81,
2554,
2599,
198,
220,
220,
220,
366,
3855,
262,
16936,
9848,
284,
787,
262,
35991,
510,
12,
3506,
526,
198,
220,
220,
220,
1441,
374,
2554,
13,
9248,
611,
374,
2554,
13,
9248,
1875,
532,
2231,
2073,
4101,
1343,
374,
2554,
13,
9248,
198,
198,
4299,
1064,
4264,
4662,
7,
9060,
2599,
198,
220,
220,
220,
366,
12468,
1088,
262,
3580,
1022,
1280,
33967,
513,
290,
1280,
33967,
604,
526,
198,
220,
220,
220,
1441,
269,
85,
17,
13,
19796,
4264,
4662,
7,
9060,
11,
269,
85,
17,
13,
2200,
5446,
62,
6369,
31800,
1847,
11,
269,
85,
17,
13,
3398,
29833,
62,
2969,
31190,
55,
62,
45,
11651,
38381,
12,
17,
60,
198,
198,
4299,
1064,
62,
354,
945,
7,
9060,
2599,
198,
220,
220,
220,
366,
16742,
262,
3435,
287,
2939,
11,
1441,
606,
355,
38375,
13621,
27787,
526,
198,
220,
220,
220,
542,
4662,
796,
1064,
4264,
4662,
7,
9060,
8,
198,
220,
220,
220,
1303,
3601,
7,
3642,
4662,
8,
198,
220,
220,
220,
374,
2554,
82,
796,
685,
24864,
515,
45474,
46491,
33967,
17,
13,
1084,
30547,
45474,
7,
66,
4008,
329,
269,
287,
542,
4662,
60,
198,
220,
220,
220,
611,
18896,
7,
3642,
4662,
8,
14512,
604,
25,
220,
1303,
1312,
290,
474,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
3642,
4662,
8,
1279,
604,
25,
220,
1303,
617,
2626,
2095,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
15684,
23307,
38143,
3474,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
16605,
62,
521,
1063,
796,
8106,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
1312,
25,
651,
62,
20337,
7,
81,
2554,
82,
58,
72,
12962,
1279,
2319,
11,
2837,
7,
11925,
7,
81,
2554,
82,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
1767,
62,
521,
1063,
796,
1351,
7,
24455,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
37456,
1312,
25,
651,
62,
20337,
7,
81,
2554,
82,
58,
72,
12962,
18189,
2319,
11,
2837,
7,
11925,
7,
81,
2554,
82,
35514,
198,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
2618,
62,
521,
1063,
8,
14512,
604,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
15684,
23307,
38143,
3474,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
329,
2566,
287,
16605,
62,
521,
1063,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16936,
796,
949,
7,
2618,
62,
521,
1063,
11,
1994,
28,
1136,
62,
30246,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7,
710,
12423,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5399,
62,
3642,
454,
796,
299,
32152,
13,
1102,
9246,
268,
378,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
3642,
4662,
58,
10989,
4357,
542,
4662,
58,
710,
12423,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
2554,
82,
58,
710,
12423,
60,
796,
18481,
515,
45474,
46491,
33967,
17,
13,
1084,
30547,
45474,
7,
46416,
62,
3642,
454,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
374,
2554,
82,
796,
685,
81,
2554,
82,
58,
72,
60,
329,
1312,
287,
1767,
62,
521,
1063,
60,
198,
220,
220,
220,
1441,
374,
2554,
82,
628,
198,
4299,
13833,
62,
81,
2554,
7,
9060,
11,
374,
2554,
11,
10330,
2599,
198,
220,
220,
220,
366,
34,
1773,
257,
38375,
35991,
422,
2939,
526,
198,
220,
220,
220,
2603,
796,
269,
85,
17,
13,
1136,
49,
14221,
46912,
17,
35,
7,
81,
2554,
13,
16159,
11,
651,
62,
9248,
7,
81,
2554,
828,
352,
8,
198,
220,
220,
220,
2546,
796,
493,
7,
81,
2554,
13,
7857,
58,
15,
48688,
36153,
9,
17,
828,
493,
7,
81,
2554,
13,
7857,
58,
16,
48688,
36153,
9,
17,
8,
198,
220,
220,
220,
611,
374,
2554,
13,
9248,
19841,
532,
2231,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2546,
796,
2546,
58,
16,
4357,
2546,
58,
15,
60,
198,
220,
220,
220,
329,
1312,
287,
357,
15,
11,
352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
2603,
58,
72,
11,
362,
60,
15853,
2546,
58,
72,
60,
1220,
362,
532,
374,
2554,
13,
16159,
58,
72,
60,
628,
220,
220,
220,
29636,
796,
269,
85,
17,
13,
86,
5117,
35191,
500,
7,
9060,
11,
2603,
11,
2546,
11,
269,
85,
17,
13,
41358,
62,
24027,
1503,
8,
198,
220,
220,
220,
1303,
3601,
7,
1136,
62,
9248,
7,
81,
2554,
828,
2546,
11,
374,
2554,
8,
198,
220,
220,
220,
1441,
29636,
628,
198,
4299,
28091,
62,
354,
945,
7,
9060,
11,
10330,
28,
15,
2599,
198,
220,
220,
220,
366,
16742,
262,
3435,
287,
262,
2939,
11,
1441,
606,
355,
4263,
526,
198,
220,
220,
220,
374,
2554,
82,
796,
23243,
7,
19796,
62,
354,
945,
7,
9060,
828,
1994,
28,
50033,
374,
2554,
25,
374,
2554,
13,
16159,
8,
198,
220,
220,
220,
48998,
796,
685,
31476,
62,
81,
2554,
7,
9060,
11,
374,
2554,
11,
10330,
8,
329,
374,
2554,
287,
374,
2554,
82,
60,
198,
220,
220,
220,
1441,
48998,
628,
198,
4299,
1673,
265,
62,
354,
945,
7,
354,
945,
11,
2546,
28,
7206,
38865,
62,
33489,
2599,
198,
220,
220,
220,
366,
3103,
9246,
268,
378,
262,
3435,
284,
1296,
257,
2187,
4286,
329,
779,
287,
256,
408,
263,
529,
526,
198,
220,
220,
220,
21978,
796,
299,
32152,
13,
9107,
418,
19510,
7857,
58,
16,
4357,
2546,
58,
15,
60,
9,
19,
828,
299,
32152,
13,
28611,
23,
8,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
19,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1149,
62,
7857,
796,
34534,
58,
72,
4083,
43358,
198,
220,
220,
220,
220,
220,
220,
220,
1029,
796,
357,
7857,
58,
16,
48688,
10641,
62,
7857,
58,
15,
12962,
1003,
17,
11,
357,
7857,
58,
15,
48688,
10641,
62,
7857,
58,
16,
12962,
1003,
17,
198,
220,
220,
220,
220,
220,
220,
220,
1877,
796,
1029,
58,
15,
45297,
10641,
62,
7857,
58,
15,
4357,
1029,
58,
16,
45297,
10641,
62,
7857,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
21978,
58,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1877,
58,
15,
5974,
1029,
58,
15,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
58,
15,
60,
9,
72,
1343,
1877,
58,
16,
5974,
2546,
58,
15,
60,
9,
72,
1343,
1029,
58,
16,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
2361,
796,
34534,
58,
72,
60,
198,
220,
220,
220,
1441,
21978,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
2939,
62,
6371,
796,
366,
7890,
25,
9060,
14,
9479,
26,
8692,
2414,
11,
72,
44526,
1581,
86,
15,
42,
38,
2188,
29697,
1565,
12564,
71,
19684,
70,
3838,
2390,
70,
3838,
6242,
4851,
32,
3539,
32,
2246,
8579,
35,
22,
47,
3838,
8120,
47920,
36,
48,
13024,
3682,
84,
18,
65,
86,
52,
18,
3620,
15199,
38,
19,
57,
49,
8068,
24,
82,
39,
75,
53,
6242,
36,
73,
4825,
70,
51,
80,
1219,
51,
2149,
79,
17,
72,
33906,
19930,
1828,
6322,
14,
17,
39,
75,
47,
84,
2200,
41,
42,
38353,
56,
87,
45,
20,
75,
54,
56,
74,
66,
39213,
70,
36,
2749,
86,
22495,
70,
38,
5639,
37,
70,
3698,
20185,
8845,
65,
4462,
24,
14,
43,
10,
86,
15,
52,
10116,
9132,
50,
2078,
39,
53,
8579,
57,
77,
5842,
2246,
4528,
10128,
65,
4760,
27654,
10917,
1477,
71,
8356,
32,
5842,
56,
76,
71,
41,
56,
55,
16,
14,
14761,
22,
32886,
67,
37,
70,
42,
86,
41,
54,
24334,
5332,
22495,
56,
3861,
57,
56,
22,
81,
3185,
41,
86,
89,
76,
89,
49136,
33191,
40,
21,
86,
41697,
41,
76,
41,
2390,
82,
43,
16,
12114,
48382,
41,
6239,
16,
2584,
80,
54,
519,
32,
80,
8505,
88,
53,
48,
742,
3697,
35,
3020,
75,
53,
88,
18293,
86,
33,
42,
80,
10,
85,
71,
21,
56,
17,
73,
7792,
5842,
22,
80,
14,
20,
71,
65,
52,
69,
2417,
48,
701,
89,
69,
48528,
55,
57,
40202,
73,
88,
41,
10,
32,
24,
5639,
2934,
322,
10,
83,
40,
2645,
85,
55,
77,
57,
35543,
53,
22,
44947,
17,
1565,
47,
65,
51,
8874,
51,
77,
87,
5488,
42,
53,
57,
33,
76,
519,
76,
36609,
54,
20362,
53,
67,
1350,
1065,
10652,
67,
86,
23820,
14,
7745,
88,
36,
16,
66,
21,
9019,
38850,
80,
81,
13534,
2417,
45,
81,
53,
48,
42,
563,
16,
48,
65,
34,
24,
57,
10468,
80,
5237,
43,
70,
39,
260,
36,
42,
38584,
25492,
86,
40,
660,
41,
14,
8845,
1652,
44,
69,
80,
79,
1073,
1921,
14,
72,
8874,
56,
70,
38,
8845,
57,
56,
39,
53,
55,
53,
17,
71,
33018,
45,
20,
4303,
404,
37,
70,
20,
67,
2290,
21,
42,
21,
80,
55,
40,
87,
17,
36,
21,
85,
17,
38,
57,
66,
46,
16,
85,
710,
80,
21762,
54,
74,
21,
79,
23303,
41,
19,
68,
17,
85,
53,
70,
23,
11230,
74,
33538,
34369,
51,
19,
45,
258,
56,
23,
81,
1820,
30743,
83,
52,
18504,
38,
79,
5662,
40,
2436,
38227,
81,
54,
53,
85,
87,
8896,
54,
57,
56,
74,
67,
24,
84,
17,
18690,
41,
36820,
53,
6413,
16,
52,
15,
35,
88,
23548,
15,
34,
80,
33,
20,
487,
1443,
20,
38,
21,
33,
42,
86,
56,
54,
19,
14,
17,
47,
86,
45,
4933,
64,
1065,
67,
89,
48,
16,
43,
41,
18274,
40760,
7278,
57,
69,
893,
15,
43,
57,
19,
75,
44,
10374,
20,
31653,
36,
10,
71,
17887,
46,
18,
14,
38227,
80,
33707,
53,
3134,
80,
54,
8068,
85,
23,
54,
73,
39568,
17,
54,
22,
33,
16,
81,
3980,
56,
54,
75,
80,
301,
35755,
55,
64,
52,
80,
19,
42,
65,
48,
75,
71,
19,
321,
9527,
27824,
10426,
46,
78,
1273,
72,
34,
42,
70,
40,
54,
76,
86,
85,
26830,
80,
70,
34,
6732,
4792,
53,
23,
32,
64,
15199,
65,
18,
9527,
11994,
43,
70,
8001,
89,
35660,
39,
22,
20185,
54,
20892,
3546,
1503,
82,
40,
72,
1503,
66,
32,
72,
56,
12473,
23286,
19,
29499,
86,
34,
2149,
37,
70,
8763,
70,
20114,
74,
21,
70,
10,
37,
57,
46,
15,
73,
42,
7355,
85,
18,
17922,
6242,
44817,
52,
20,
9139,
74,
41,
1130,
70,
855,
1,
198,
220,
220,
220,
2939,
796,
1100,
62,
8692,
2414,
7,
9060,
62,
6371,
8,
198,
220,
220,
220,
269,
85,
17,
13,
320,
12860,
7203,
10677,
1600,
2939,
8,
198,
220,
220,
220,
34534,
796,
28091,
62,
354,
945,
7,
9060,
8,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
19,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
320,
12860,
7,
69,
1,
22769,
1391,
72,
92,
1600,
34534,
58,
72,
12962,
198,
220,
220,
220,
1673,
265,
796,
1673,
265,
62,
354,
945,
7,
354,
945,
8,
198,
220,
220,
220,
269,
85,
17,
13,
320,
12860,
7203,
1102,
9246,
1600,
1673,
265,
8,
198,
220,
220,
220,
1303,
269,
85,
17,
13,
320,
13564,
7203,
66,
13,
11134,
1600,
5299,
1102,
9246,
8,
198,
220,
220,
220,
269,
85,
17,
13,
17077,
9218,
3419,
198
] | 2.010254 | 2,243 |
import ubelt as ub
import numpy as np
from . import embeding
from . import util
__all__ = ['InteractiveIter']
INDEXABLE_TYPES = (list, tuple, np.ndarray)
class InteractiveIter(object):
"""
Choose next value interactively
iterable should be a list, not a generator. sorry
"""
def __init__(iiter, iterable=None, enabled=True, startx=0,
default_action='next', custom_actions=[], wraparound=False,
display_item=False, verbose=True):
r"""
Args:
iterable (None): (default = None)
enabled (bool): (default = True)
startx (int): (default = 0)
default_action (str): (default = 'next')
custom_actions (list): list of 4-tuple (name, actions, help, func) (default = [])
wraparound (bool): (default = False)
display_item (bool): (default = True)
verbose (bool): verbosity flag(default = True)
Example:
>>> # DISABLE_DOCTEST
>>> from xdev.interactive_iter import * # NOQA
>>> iterable = [1, 2, 3]
>>> enabled = True
>>> startx = 0
>>> default_action = 'next'
>>> custom_actions = []
>>> wraparound = False
>>> display_item = True
>>> verbose = True
>>> iiter = InteractiveIter(iterable, enabled, startx, default_action, custom_actions, wraparound, display_item, verbose)
>>> for _ in iiter:
>>> pass
Example:
>>> # DISABLE_DOCTEST
>>> # Interactive matplotlib stuff
>>> from xdev.interactive_iter import * # NOQA
>>> import kwimage
>>> import kwplot
>>> kwplot.autompl()
>>> keys = list(kwimage.grab_test_image.keys())
>>> iterable = [kwimage.grab_test_image(key) for key in keys]
>>> iiter = InteractiveIter(iterable)
>>> for img in iiter:
>>> kwplot.imshow(img)
>>> InteractiveIter.draw()
"""
iiter.wraparound = wraparound
iiter.enabled = enabled
iiter.iterable = iterable
for actiontup in custom_actions:
if isinstance(custom_actions, tuple):
pass
else:
pass
iiter.custom_actions = util.take_column(custom_actions, [0, 1, 2])
iiter.custom_funcs = util.take_column(custom_actions, 3)
iiter.action_tuples = [
# (name, list, help)
('next', ['n'], 'move to the next index'),
('prev', ['p'], 'move to the previous index'),
('reload', ['r'], 'stay at the same index'),
('index', ['x', 'i', 'index'], 'move to that index'),
('set', ['set'], 'set current index value'),
('ipy', ['ipy', 'ipython', 'cmd'], 'start IPython'),
('quit', ['q', 'exit', 'quit'], 'quit'),
] + iiter.custom_actions
default_action_index = util.take_column(iiter.action_tuples, 0).index(default_action)
iiter.action_tuples[default_action_index][1].append('')
iiter.action_keys = {tup[0]: tup[1] for tup in iiter.action_tuples}
iiter.index = startx
iiter.display_item = display_item
iiter.verbose = verbose
@classmethod
def eventloop(cls, custom_actions=[]):
"""
For use outside of iteration wrapping. Makes an interactive event loop
custom_actions should be specified in format
[dispname, keys, desc, func]
"""
iiter = cls([None], custom_actions=custom_actions, verbose=False)
print('[IITER] Begining interactive main loop')
for _ in iiter:
pass
return iiter
def handle_ans(iiter, ans_):
"""
preforms an actionm based on a user answer
"""
ans = ans_.strip(' ')
# Handle standard actions
if ans in iiter.action_keys['quit']:
raise StopIteration()
elif ans in iiter.action_keys['prev']:
iiter.index -= 1
elif ans in iiter.action_keys['next']:
iiter.index += 1
elif ans in iiter.action_keys['reload']:
iiter.index += 0
elif chack_if_answer_was(iiter.action_keys['index']):
try:
iiter.index = int(parse_str_value(ans))
except ValueError:
print('Unknown ans=%r' % (ans,))
elif chack_if_answer_was(iiter.action_keys['set']):
try:
iiter.iterable[iiter.index] = eval(parse_str_value(ans))
except ValueError:
print('Unknown ans=%r' % (ans,))
elif ans in iiter.action_keys['ipy']:
return 'IPython'
else:
# Custom interactions
for func, tup in zip(iiter.custom_funcs, iiter.custom_actions):
key = tup[0]
if chack_if_answer_was(iiter.action_keys[key]):
value = parse_str_value(ans)
# cal custom function
print('Calling custom action func')
import inspect
argspec = inspect.getfullargspec(func)
if len(argspec.args) == 3:
# Forgot why I had custom functions take args in the first place
func(iiter, key, value)
else:
func()
# Custom funcs dont cause iteration
return False
print('Unknown ans=%r' % (ans,))
return False
return True
@classmethod
def draw(iiter):
"""
in the common case where InteractiveIter is used to view matplotlib
figures, you will have to draw the figure manually. This is a helper
for that task.
"""
from matplotlib import pyplot as plt
fig = plt.gcf()
fig.canvas.draw()
| [
11748,
20967,
2120,
355,
20967,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
1330,
11525,
278,
198,
6738,
764,
1330,
7736,
198,
198,
834,
439,
834,
796,
37250,
9492,
5275,
29993,
20520,
628,
198,
12115,
6369,
17534,
62,
9936,
47,
1546,
796,
357,
4868,
11,
46545,
11,
45941,
13,
358,
18747,
8,
628,
198,
4871,
21365,
29993,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
17489,
1306,
1988,
9427,
2280,
628,
220,
220,
220,
11629,
540,
815,
307,
257,
1351,
11,
407,
257,
17301,
13,
7926,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
825,
11593,
15003,
834,
7,
72,
2676,
11,
11629,
540,
28,
14202,
11,
9343,
28,
17821,
11,
923,
87,
28,
15,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
62,
2673,
11639,
19545,
3256,
2183,
62,
4658,
41888,
4357,
7917,
1845,
633,
28,
25101,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3359,
62,
9186,
28,
25101,
11,
15942,
577,
28,
17821,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
374,
37811,
198,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11629,
540,
357,
14202,
2599,
357,
12286,
796,
6045,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9343,
357,
30388,
2599,
357,
12286,
796,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
923,
87,
357,
600,
2599,
357,
12286,
796,
657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
62,
2673,
357,
2536,
2599,
357,
12286,
796,
705,
19545,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2183,
62,
4658,
357,
4868,
2599,
1351,
286,
604,
12,
83,
29291,
357,
3672,
11,
4028,
11,
1037,
11,
25439,
8,
357,
12286,
796,
685,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7917,
1845,
633,
357,
30388,
2599,
357,
12286,
796,
10352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3359,
62,
9186,
357,
30388,
2599,
357,
12286,
796,
6407,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15942,
577,
357,
30388,
2599,
220,
15942,
16579,
6056,
7,
12286,
796,
6407,
8,
628,
220,
220,
220,
220,
220,
220,
220,
17934,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
1303,
13954,
17534,
62,
18227,
4177,
6465,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
422,
2124,
7959,
13,
3849,
5275,
62,
2676,
1330,
1635,
220,
1303,
8005,
48,
32,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
11629,
540,
796,
685,
16,
11,
362,
11,
513,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
9343,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
923,
87,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
4277,
62,
2673,
796,
705,
19545,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
2183,
62,
4658,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
7917,
1845,
633,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
3359,
62,
9186,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
15942,
577,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
1312,
2676,
796,
21365,
29993,
7,
2676,
540,
11,
9343,
11,
923,
87,
11,
4277,
62,
2673,
11,
2183,
62,
4658,
11,
7917,
1845,
633,
11,
3359,
62,
9186,
11,
15942,
577,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
329,
4808,
287,
1312,
2676,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
220,
220,
220,
220,
1208,
628,
220,
220,
220,
220,
220,
220,
220,
17934,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
1303,
13954,
17534,
62,
18227,
4177,
6465,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
1303,
21365,
2603,
29487,
8019,
3404,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
422,
2124,
7959,
13,
3849,
5275,
62,
2676,
1330,
1635,
220,
1303,
8005,
48,
32,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
1330,
479,
86,
9060,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
1330,
479,
86,
29487,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
479,
86,
29487,
13,
2306,
6316,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
8251,
796,
1351,
7,
46265,
9060,
13,
32393,
62,
9288,
62,
9060,
13,
13083,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
11629,
540,
796,
685,
46265,
9060,
13,
32393,
62,
9288,
62,
9060,
7,
2539,
8,
329,
1994,
287,
8251,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
1312,
2676,
796,
21365,
29993,
7,
2676,
540,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
329,
33705,
287,
1312,
2676,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
220,
220,
220,
220,
479,
86,
29487,
13,
320,
12860,
7,
9600,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13163,
220,
220,
220,
220,
21365,
29993,
13,
19334,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
29988,
1845,
633,
796,
7917,
1845,
633,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
25616,
796,
9343,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
2676,
540,
796,
11629,
540,
628,
220,
220,
220,
220,
220,
220,
220,
329,
2223,
83,
929,
287,
2183,
62,
4658,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
318,
39098,
7,
23144,
62,
4658,
11,
46545,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
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,
1208,
628,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
23144,
62,
4658,
796,
7736,
13,
20657,
62,
28665,
7,
23144,
62,
4658,
11,
685,
15,
11,
352,
11,
362,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
23144,
62,
12543,
6359,
796,
7736,
13,
20657,
62,
28665,
7,
23144,
62,
4658,
11,
513,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
2673,
62,
28047,
2374,
796,
685,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
357,
3672,
11,
1351,
11,
1037,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19203,
19545,
3256,
220,
220,
37250,
77,
6,
4357,
705,
21084,
284,
262,
1306,
6376,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19203,
47050,
3256,
220,
220,
37250,
79,
6,
4357,
705,
21084,
284,
262,
2180,
6376,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19203,
260,
2220,
3256,
37250,
81,
6,
4357,
705,
31712,
379,
262,
976,
6376,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19203,
9630,
3256,
220,
37250,
87,
3256,
705,
72,
3256,
705,
9630,
6,
4357,
705,
21084,
284,
326,
6376,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19203,
2617,
3256,
220,
220,
220,
37250,
2617,
6,
4357,
705,
2617,
1459,
6376,
1988,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19203,
541,
88,
3256,
220,
220,
220,
37250,
541,
88,
3256,
705,
541,
7535,
3256,
705,
28758,
6,
4357,
705,
9688,
6101,
7535,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19203,
47391,
3256,
220,
220,
37250,
80,
3256,
705,
37023,
3256,
705,
47391,
6,
4357,
705,
47391,
33809,
198,
220,
220,
220,
220,
220,
220,
220,
2361,
1343,
1312,
2676,
13,
23144,
62,
4658,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
62,
2673,
62,
9630,
796,
7736,
13,
20657,
62,
28665,
7,
72,
2676,
13,
2673,
62,
28047,
2374,
11,
657,
737,
9630,
7,
12286,
62,
2673,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
2673,
62,
28047,
2374,
58,
12286,
62,
2673,
62,
9630,
7131,
16,
4083,
33295,
7,
7061,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
2673,
62,
13083,
796,
1391,
83,
929,
58,
15,
5974,
256,
929,
58,
16,
60,
329,
256,
929,
287,
1312,
2676,
13,
2673,
62,
28047,
2374,
92,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
9630,
796,
923,
87,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
13812,
62,
9186,
796,
3359,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
19011,
577,
796,
15942,
577,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
1785,
26268,
7,
565,
82,
11,
2183,
62,
4658,
28,
21737,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1114,
779,
2354,
286,
24415,
27074,
13,
27433,
281,
14333,
1785,
9052,
198,
220,
220,
220,
220,
220,
220,
220,
2183,
62,
4658,
815,
307,
7368,
287,
5794,
198,
220,
220,
220,
220,
220,
220,
220,
685,
6381,
79,
3672,
11,
8251,
11,
1715,
11,
25439,
60,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
796,
537,
82,
26933,
14202,
4357,
2183,
62,
4658,
28,
23144,
62,
4658,
11,
15942,
577,
28,
25101,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
58,
40,
2043,
1137,
60,
16623,
278,
14333,
1388,
9052,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
329,
4808,
287,
1312,
2676,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1312,
2676,
628,
220,
220,
220,
825,
5412,
62,
504,
7,
72,
2676,
11,
9093,
62,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
662,
23914,
281,
2223,
76,
1912,
319,
257,
2836,
3280,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
9093,
796,
9093,
44807,
36311,
10786,
705,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
33141,
3210,
4028,
198,
220,
220,
220,
220,
220,
220,
220,
611,
9093,
287,
1312,
2676,
13,
2673,
62,
13083,
17816,
47391,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5298,
13707,
29993,
341,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
9093,
287,
1312,
2676,
13,
2673,
62,
13083,
17816,
47050,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
9630,
48185,
352,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
9093,
287,
1312,
2676,
13,
2673,
62,
13083,
17816,
19545,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
9630,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
9093,
287,
1312,
2676,
13,
2673,
62,
13083,
17816,
260,
2220,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
2676,
13,
9630,
15853,
657,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
442,
441,
62,
361,
62,
41484,
62,
9776,
7,
72,
2676,
13,
2673,
62,
13083,
17816,
9630,
20520,
2599,
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,
1312,
2676,
13,
9630,
796,
493,
7,
29572,
62,
2536,
62,
8367,
7,
504,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
11052,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
20035,
9093,
28,
4,
81,
6,
4064,
357,
504,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
442,
441,
62,
361,
62,
41484,
62,
9776,
7,
72,
2676,
13,
2673,
62,
13083,
17816,
2617,
20520,
2599,
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,
1312,
2676,
13,
2676,
540,
58,
72,
2676,
13,
9630,
60,
796,
5418,
7,
29572,
62,
2536,
62,
8367,
7,
504,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2845,
11052,
12331,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
20035,
9093,
28,
4,
81,
6,
4064,
357,
504,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
9093,
287,
1312,
2676,
13,
2673,
62,
13083,
17816,
541,
88,
6,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
705,
4061,
7535,
6,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
8562,
12213,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
25439,
11,
256,
929,
287,
19974,
7,
72,
2676,
13,
23144,
62,
12543,
6359,
11,
1312,
2676,
13,
23144,
62,
4658,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
796,
256,
929,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
442,
441,
62,
361,
62,
41484,
62,
9776,
7,
72,
2676,
13,
2673,
62,
13083,
58,
2539,
60,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
220,
796,
21136,
62,
2536,
62,
8367,
7,
504,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2386,
2183,
2163,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
48593,
2183,
2223,
25439,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1330,
10104,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1822,
16684,
796,
10104,
13,
1136,
12853,
853,
16684,
7,
20786,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
853,
16684,
13,
22046,
8,
6624,
513,
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,
1303,
1114,
23442,
1521,
314,
550,
2183,
5499,
1011,
26498,
287,
262,
717,
1295,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25439,
7,
72,
2676,
11,
1994,
11,
1988,
8,
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,
25439,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
8562,
1257,
6359,
17666,
2728,
24415,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
20035,
9093,
28,
4,
81,
6,
4064,
357,
504,
11,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
6407,
628,
220,
220,
220,
2488,
4871,
24396,
198,
220,
220,
220,
825,
3197,
7,
72,
2676,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
287,
262,
2219,
1339,
810,
21365,
29993,
318,
973,
284,
1570,
2603,
29487,
8019,
198,
220,
220,
220,
220,
220,
220,
220,
5538,
11,
345,
481,
423,
284,
3197,
262,
3785,
14500,
13,
770,
318,
257,
31904,
198,
220,
220,
220,
220,
220,
220,
220,
329,
326,
4876,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
422,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
220,
220,
220,
220,
220,
220,
220,
2336,
796,
458,
83,
13,
70,
12993,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
2336,
13,
5171,
11017,
13,
19334,
3419,
198
] | 2.043153 | 2,943 |
import cv2 as cv
import numpy as np
import kociemba
DEBUG = False
eps = 0.00001
firstRead = []
secondRead = []
firstDone = False
cam = cv.VideoCapture(0)
cam.set(cv.CAP_PROP_FRAME_HEIGHT, 720)
W, H = int(cam.get(cv.CAP_PROP_FRAME_WIDTH)), int(cam.get(cv.CAP_PROP_FRAME_HEIGHT))
if W != 1280 or H != 720:
print("WARNING!!! This software was prepared according to 1280x720 camera resolution, but your resolution is %dx%d, this may or may not cause problems" % (W, H))
color_white = (255, 255, 255)
color_yellow = (0, 255, 255)
color_red = (0, 0, 255)
color_orange = (0, 162, 255)
color_green = (0, 255, 0)
color_blue = (255, 0, 0)
while True:
isTrue, raw = cam.read()
if isTrue == False:
break
raw = cv.flip(raw, 1)
if firstDone == False:
raw = cv.rectangle(raw, (0, H-40), (W, H), (55, 55, 55), -1)
raw = cv.putText(raw, "Show one corner of the cube to the camera, Q to exit", (10, H-12), cv.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255))
else:
raw = cv.circle(raw, (40, H-50), 100, (255, 255, 255), -1)
raw = cv.line(raw, (40, H-50), (100, H-110), (0, 150, 0), 10)
raw = cv.line(raw, (10, H-80), (40, H-50), (0, 150, 0), 10)
raw = cv.rectangle(raw, (0, H-40), (W, H), (55, 55, 55), -1)
raw = cv.putText(raw, "Now show the opposite corner to the camera, Q to exit", (10, H-12), cv.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255))
#* canny edge detection
blur = cv.medianBlur(raw, 7)
canny = cv.Canny(blur, 50, 150)
scanning_areas = canny.copy()
canny_gray = canny.copy()
canny = cv.cvtColor(canny, cv.COLOR_GRAY2BGR)
#* Draw cube skeleton
pts = np.array([
[665, 115],
[885, 200],
[855, 428],
[675, 571],
[490, 434],
[454, 211]
], np.int32)
pts.reshape((-1, 1, 2))
if DEBUG:
canny = cv.polylines(canny, [pts], True, (0, 255, 0), 3)
canny = cv.circle(canny, (675, 342), 30, (0, 0, 255))
canny = cv.circle(canny, (675, 342), 50, (0, 0, 255))
else:
raw = cv.polylines(raw, [pts], True, (0, 255, 0), 3)
raw = cv.line(raw, (885, 200), (675, 342), (0, 255, 0), 3)
raw = cv.line(raw, (675, 571), (675, 342), (0, 255, 0), 3)
raw = cv.line(raw, (454, 211), (675, 342), (0, 255, 0), 3)
cube_area = area(pts)
#* Draw two circles centered at the corner, find intersection points with edges
little_circle_points = []
big_circle_points = []
points = cv.ellipse2Poly((675, 342), (30, 30), 0, 0, 360, 1)
for (x, y) in points:
if canny_gray[y, x] == 255:
if len(little_circle_points) == 0 or distance((x, y), little_circle_points[-1]) > 30:
little_circle_points.append((x, y))
points = cv.ellipse2Poly((675, 342), (50, 50), 0, 0, 360, 1)
for (x, y) in points:
if canny_gray[y, x] == 255:
if len(big_circle_points) == 0 or distance((x, y), big_circle_points[-1]) > 30:
big_circle_points.append((x, y))
all_edges_found = False
if len(little_circle_points) > 0 and len(big_circle_points) > 0 and distance(little_circle_points[0], big_circle_points[0]) < 22:
canny = cv.line(canny, little_circle_points[0], big_circle_points[0], (0, 255, 0), 2)
if len(little_circle_points) > 1 and len(big_circle_points) > 1 and distance(little_circle_points[1], big_circle_points[1]) < 22:
canny = cv.line(canny, little_circle_points[1], big_circle_points[1], (0, 255, 0), 2)
if len(little_circle_points) > 2 and len(big_circle_points) > 2 and distance(little_circle_points[2], big_circle_points[2]) < 22:
canny = cv.line(canny, little_circle_points[2], big_circle_points[2], (0, 255, 0), 2)
all_edges_found = True
if all_edges_found:
#* All found points
x1, y1 = little_circle_points[0][0] + eps, little_circle_points[0][1] + eps
x2, y2 = big_circle_points[0][0], big_circle_points[0][1]
x3, y3 = little_circle_points[1][0] + eps, little_circle_points[1][1] + eps
x4, y4 = big_circle_points[1][0], big_circle_points[1][1]
x5, y5 = little_circle_points[2][0] + eps, little_circle_points[2][1] + eps
x6, y6 = big_circle_points[2][0], big_circle_points[2][1]
#* Find middle corner
axis1, center_y1 = intersection(x1, y1, x2, y2, x3, y3, x4, y4)
axis2, center_y2 = intersection(x3, y3, x4, y4, x5, y5, x6, y6)
center_x3, center_y3 = intersection(x5, y5, x6, y6, x1, y1, x2, y2)
center_x, center_y = (axis1 + axis2 + center_x3)/3, (center_y1 + center_y2 + center_y3)/3
center = int(center_x), int(center_y)
if center_x > 100000 or center_y > 100000:
continue
if DEBUG and 0 < center_x < 1000 and 0 < center_y < 1000:
canny = cv.circle(canny, center, 5, (255, 255, 0), -1)
#* Find corners near middle corner
dilated_edges = cv.dilate(canny, np.ones((10, 10), np.uint8))
dx, dy = big_circle_points[0][0] - little_circle_points[0][0], big_circle_points[0][1] - little_circle_points[0][1]
dx, dy = dx/length((dx, dy)), dy/length((dx, dy))
corner1_x, corner1_y = center_x + dx*200, center_y + dy*200
while 0 < corner1_x < W and 0 < corner1_y < H:
if dilated_edges[int(corner1_y), int(corner1_x)].all() == 0:
break
corner1_x += dx
corner1_y += dy
corner1_x -= 5*dx
corner1_y -= 5*dy
dx, dy = big_circle_points[1][0] - little_circle_points[1][0], big_circle_points[1][1] - little_circle_points[1][1]
dx, dy = dx/length((dx, dy)), dy/length((dx, dy))
corner2_x, corner2_y = center_x + dx*200, center_y + dy*200
canny = cv.circle(canny, (int(corner2_x), int(corner2_y)), 10, (0, 0, 255))
while 0 < corner2_x < W and 0 < corner2_y < H:
if dilated_edges[int(corner2_y), int(corner2_x)].all() == 0:
break
corner2_x += dx
corner2_y += dy
corner2_x -= 5*dx
corner2_y -= 5*dy
dx, dy = big_circle_points[2][0] - little_circle_points[2][0], big_circle_points[2][1] - little_circle_points[2][1]
dx, dy = dx/length((dx, dy)), dy/length((dx, dy))
corner3_x, corner3_y = center_x + dx*200, center_y + dy*200
while 0 < corner3_x < W and 0 < corner3_y < H:
if dilated_edges[int(corner3_y), int(corner3_x)].all() == 0:
break
corner3_x += dx
corner3_y += dy
corner3_x -= 5*dx
corner3_y -= 5*dy
corner1 = (int(corner1_x), int(corner1_y))
corner2 = (int(corner2_x), int(corner2_y))
corner3 = (int(corner3_x), int(corner3_y))
if DEBUG:
canny = cv.circle(canny, corner1, 10, (0, 0, 255))
canny = cv.circle(canny, corner2, 10, (0, 0, 255))
canny = cv.circle(canny, corner3, 10, (0, 0, 255))
#* Estimate other corners
far_corner1 = plus(minus(corner1, center), corner2)
far_corner2 = plus(minus(corner2, center), corner3)
far_corner3 = plus(minus(corner3, center), corner1)
far_corner1 = minus(far_corner1, times(0.13, minus(far_corner1, center)))
far_corner2 = minus(far_corner2, times(0.13, minus(far_corner2, center)))
far_corner3 = minus(far_corner3, times(0.13, minus(far_corner3, center)))
far_corner1 = (int(far_corner1[0]), int(far_corner1[1]))
far_corner2 = (int(far_corner2[0]), int(far_corner2[1]))
far_corner3 = (int(far_corner3[0]), int(far_corner3[1]))
#* Check if calculated area and skeleton area matches
unsuccessful = False
calculated_area = area([corner1, far_corner1, corner2, far_corner2, corner3, far_corner3])
error = abs(calculated_area - cube_area)/cube_area
if error < 0.1:
if DEBUG:
canny = cv.circle(canny, far_corner1, 10, (0, 0, 255))
canny = cv.circle(canny, far_corner2, 10, (0, 0, 255))
canny = cv.circle(canny, far_corner3, 10, (0, 0, 255))
scanning_areas = cv.circle(scanning_areas, corner1, 10, (255, 255, 255))
scanning_areas = cv.circle(scanning_areas, corner2, 10, (255, 255, 255))
scanning_areas = cv.circle(scanning_areas, corner3, 10, (255, 255, 255))
scanning_areas = cv.circle(scanning_areas, far_corner1, 10, (255, 255, 255))
scanning_areas = cv.circle(scanning_areas, far_corner2, 10, (255, 255, 255))
scanning_areas = cv.circle(scanning_areas, far_corner3, 10, (255, 255, 255))
#* Divide faces and extract colors
read = []
for faces in range(3):
if faces == 0:
axis1 = minus(corner1, center)
axis2 = minus(corner2, center)
elif faces == 1:
axis1 = minus(corner2, center)
axis2 = minus(corner3, center)
else:
axis1 = minus(corner3, center)
axis2 = minus(corner1, center)
for i in range(3):
for j in range(3):
piece_corner1 = plus(center, plus(times( i /3, axis1), times( j /3, axis2)))
piece_corner2 = plus(center, plus(times((i+1)/3, axis1), times( j /3, axis2)))
piece_corner3 = plus(center, plus(times( i /3, axis1), times((j+1)/3, axis2)))
piece_corner4 = plus(center, plus(times((i+1)/3, axis1), times((j+1)/3, axis2)))
piece_corner1 = minus(piece_corner1, times(0.13*min(i , j )/3, minus(piece_corner1, center)))
piece_corner2 = minus(piece_corner2, times(0.13*min(i+1, j )/3, minus(piece_corner2, center)))
piece_corner3 = minus(piece_corner3, times(0.13*min(i , j+1)/3, minus(piece_corner3, center)))
piece_corner4 = minus(piece_corner4, times(0.13*min(i+1, j+1)/3, minus(piece_corner4, center)))
piece_mask = np.zeros((canny.shape[0], canny.shape[1]), np.uint8)
pts = np.array([
[piece_corner1[0], piece_corner1[1]],
[piece_corner2[0], piece_corner2[1]],
[piece_corner4[0], piece_corner4[1]],
[piece_corner3[0], piece_corner3[1]]
], np.int32)
pts.reshape((-1, 1, 2))
piece_mask = cv.fillPoly(piece_mask, [pts], (255, 255, 255))
piece_mask = cv.erode(piece_mask, np.ones((35,35), np.uint8)) # erode to prevent little misplacements
scanning_areas = cv.bitwise_or(scanning_areas, piece_mask)
# uncomment for higher accuracy but hard match
# edge_check = cv.mean(canny, piece_mask)
# if edge_check[0] > 0:
# olmadi = True
#* If color picking area is so small, retreat
cube_area = cv.mean(piece_mask)
if cube_area[0] < 0.005:
unsuccessful = True
read_color = cv.mean(raw, piece_mask)
if DEBUG:
canny = cv.fillPoly(canny, [pts], (int(read_color[0]), int(read_color[1]), int(read_color[2])))
read.append((read_color[0], read_color[1], read_color[2]))
if DEBUG:
cv.imshow('scanning_areas', scanning_areas)
if unsuccessful:
continue
if not firstRead:
firstRead = read
firstDone = True
if DEBUG:
cv.imshow('first read', canny)
cv.imshow('first read raw', raw)
else:
difference = 0
for i in range(len(read)):
for j in range(3):
difference += (firstRead[i][j] - read[i][j])**2
if difference > 270000:
secondRead = read
reads = firstRead + secondRead
if DEBUG:
cv.imshow('ikinci okuma', canny)
cv.imshow('ikinci okuma raw', raw)
print(reads)
#* Determine which color which
color_groups = [[], [], [], [], [], []]
reads = turnHSV(reads)
# First 9 least saturated color is white
reads = reads[reads[:,1].argsort()]
for i in range(9):
color_groups[0].append(int(reads[i][3]))
reads = reads[9:]
# Other colors are determined according to their hue value
reads = reads[reads[:,0].argsort()]
for j in range(1, 6):
for i in range(9):
color_groups[j].append(int(reads[(j-1)*9 + i][3]))
where = []
for i in range(54):
where.append(-1)
for i in range(6):
for j in range(9):
where[color_groups[i][j]] = i
cube_list = []
for i in range(54):
cube_list.append(-1)
#* Find places of pieces and fill
fill(cube_list, where[0:9], where[13])
fill(cube_list, where[9:18], where[22])
fill(cube_list, where[18:27], where[4])
fill(cube_list, where[27:36], where[40])
fill(cube_list, where[36:45], where[49])
fill(cube_list, where[45:54], where[31])
#* Create result image
result = np.zeros((H, W, 3), np.uint8)
seperatorThickness = 2
for i in range(3):
for j in range(3):
px = 10 + 150 + 10
py = 10
result = cv.rectangle(result, (px + i*50, py + j*50), (px + (i+1)*50, py + (j+1)*50), getcolor(cube_list[i+j*3]), -1)
result = cv.rectangle(result, (px, py), (px + 100, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px + 50, py), (px + 150, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px, py + 50), (px + 150, py + 100), (0, 0, 0), seperatorThickness)
for i in range(3):
for j in range(3):
px = 10
py = 10 + 150 + 10
result = cv.rectangle(result, (px + i*50, py + j*50), (px + (i+1)*50, py + (j+1)*50), getcolor(cube_list[9+i+j*3]), -1)
result = cv.rectangle(result, (px, py), (px + 100, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px + 50, py), (px + 150, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px, py + 50), (px + 150, py + 100), (0, 0, 0), seperatorThickness)
for i in range(3):
for j in range(3):
px = 10 + 150 + 10
py = 10 + 150 + 10
result = cv.rectangle(result, (px + i*50, py + j*50), (px + (i+1)*50, py + (j+1)*50), getcolor(cube_list[18+i+j*3]), -1)
result = cv.rectangle(result, (px, py), (px + 100, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px + 50, py), (px + 150, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px, py + 50), (px + 150, py + 100), (0, 0, 0), seperatorThickness)
for i in range(3):
for j in range(3):
px = 10 + 150 + 10 + 150 + 10
py = 10 + 150 + 10
result = cv.rectangle(result, (px + i*50, py + j*50), (px + (i+1)*50, py + (j+1)*50), getcolor(cube_list[27+i+j*3]), -1)
result = cv.rectangle(result, (px, py), (px + 100, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px + 50, py), (px + 150, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px, py + 50), (px + 150, py + 100), (0, 0, 0), seperatorThickness)
for i in range(3):
for j in range(3):
px = 10 + 150 + 10 + 150 + 10 + 150 + 10
py = 10 + 150 + 10
result = cv.rectangle(result, (px + i*50, py + j*50), (px + (i+1)*50, py + (j+1)*50), getcolor(cube_list[36+i+j*3]), -1)
result = cv.rectangle(result, (px, py), (px + 100, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px + 50, py), (px + 150, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px, py + 50), (px + 150, py + 100), (0, 0, 0), seperatorThickness)
for i in range(3):
for j in range(3):
px = 10 + 150 + 10
py = 10 + 150 + 10 + 150 + 10
result = cv.rectangle(result, (px + i*50, py + j*50), (px + (i+1)*50, py + (j+1)*50), getcolor(cube_list[45+i+j*3]), -1)
result = cv.rectangle(result, (px, py), (px + 100, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px + 50, py), (px + 150, py + 150), (0, 0, 0), seperatorThickness)
result = cv.rectangle(result, (px, py + 50), (px + 150, py + 100), (0, 0, 0), seperatorThickness)
kociemba_input_style = cube_list[0:9] + cube_list[27:36] + cube_list[18:27] + cube_list[45:54] + cube_list[9:18] + cube_list[36:45]
kociemba_text = str(kociemba_input_style).replace('[', '').replace(']', '').replace(',', '').replace(' ', '')
kociemba_text = kociemba_text.replace('0', 'U')
kociemba_text = kociemba_text.replace('1', 'B')
kociemba_text = kociemba_text.replace('2', 'F')
kociemba_text = kociemba_text.replace('3', 'D')
kociemba_text = kociemba_text.replace('4', 'R')
kociemba_text = kociemba_text.replace('5', 'L')
solution = ""
try:
solution = kociemba.solve(kociemba_text)
except:
solution = "Sorry, this cube cannot be solved. Try again"
result = cv.putText(result, "White on top, Orange in front", (10, 520), cv.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255))
result = cv.putText(result, solution, (10, 560), cv.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255))
result = cv.putText(result, "R to retry, Q to quit", (10, 600), cv.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255))
dx = (W - 650) // 6
dy = 500 // 4
if solution[0] != 'S':
solution_array = solution.split()
for j in range(4):
for i in range(6):
number = j*6 + i
if len(solution_array) <= number:
break
center = 650 + i*dx + dx//2, j*dy + dy//2
minax = min(dx, dy)
color = (0, 0, 0)
if solution_array[number][0] == 'U':
color = color_white[0], color_white[1], color_white[2]
elif solution_array[number][0] == 'L':
color = color_blue[0], color_blue[1], color_blue[2]
elif solution_array[number][0] == 'F':
color = color_orange[0], color_orange[1], color_orange[2]
elif solution_array[number][0] == 'R':
color = color_green[0], color_green[1], color_green[2]
elif solution_array[number][0] == 'B':
color = color_red[0], color_red[1], color_red[2]
elif solution_array[number][0] == 'D':
color = color_yellow[0], color_yellow[1], color_yellow[2]
result = cv.rectangle(result, (center[0] - int(minax*0.2), center[1] - int(minax*0.2)), (center[0] + int(minax*0.2), center[1] + int(minax*0.2)), color, -1)
if len(solution_array[number]) == 1:
result = cv.ellipse(result, center, (int(minax*0.4), int(minax*0.4)), 0, -90, 0, (0, 255, 0), 3)
result = cv.line(result, (center[0] + int(minax*0.4), center[1]), (center[0] + int(minax*0.4) + int(minax*0.05), center[1] - int(minax*0.05)), (0, 255, 0), 3)
result = cv.line(result, (center[0] + int(minax*0.4), center[1]), (center[0] + int(minax*0.4) - int(minax*0.05), center[1] - int(minax*0.05)), (0, 255, 0), 3)
elif solution_array[number][1] == "'":
result = cv.ellipse(result, center, (int(minax*0.4), int(minax*0.4)), 0, -90, -180, (0, 255, 0), 3)
result = cv.line(result, (center[0] - int(minax*0.4), center[1]), (center[0] - int(minax*0.4) + int(minax*0.05), center[1] - int(minax*0.05)), (0, 255, 0), 3)
result = cv.line(result, (center[0] - int(minax*0.4), center[1]), (center[0] - int(minax*0.4) - int(minax*0.05), center[1] - int(minax*0.05)), (0, 255, 0), 3)
else:
result = cv.ellipse(result, center, (int(minax*0.4), int(minax*0.4)), 0, -90, 90, (0, 255, 0), 3)
result = cv.line(result, (center[0], center[1] + int(minax*0.4)), (center[0] + int(minax*0.05), center[1] + int(minax*0.4) - int(minax*0.05)), (0, 255, 0), 3)
result = cv.line(result, (center[0], center[1] + int(minax*0.4)), (center[0] + int(minax*0.05), center[1] + int(minax*0.4) + int(minax*0.05)), (0, 255, 0), 3)
cv.imshow("Rubik's Cube Solver", result)
while True:
option = cv.waitKey() & 0xff
if option == ord('r') or option == ord('R'):
firstDone = False
firstRead = []
secondRead = []
break
elif option == ord('q') or option == ord('Q'):
exit(0)
if DEBUG:
cv.imshow('canny', canny)
else:
cv.imshow("Rubik's Cube Solver", raw)
key = cv.waitKey(20)
if key == ord('q') or key == ord('Q'):
break
| [
11748,
269,
85,
17,
355,
269,
85,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
479,
1733,
368,
7012,
198,
198,
30531,
796,
10352,
198,
25386,
796,
657,
13,
2388,
16,
198,
11085,
5569,
796,
17635,
198,
12227,
5569,
796,
17635,
198,
11085,
45677,
796,
10352,
198,
198,
20991,
796,
269,
85,
13,
10798,
49630,
7,
15,
8,
198,
20991,
13,
2617,
7,
33967,
13,
33177,
62,
4805,
3185,
62,
10913,
10067,
62,
13909,
9947,
11,
26250,
8,
198,
54,
11,
367,
796,
493,
7,
20991,
13,
1136,
7,
33967,
13,
33177,
62,
4805,
3185,
62,
10913,
10067,
62,
54,
2389,
4221,
36911,
493,
7,
20991,
13,
1136,
7,
33967,
13,
33177,
62,
4805,
3185,
62,
10913,
10067,
62,
13909,
9947,
4008,
198,
361,
370,
14512,
37674,
393,
367,
14512,
26250,
25,
198,
220,
220,
220,
3601,
7203,
31502,
10185,
770,
3788,
373,
5597,
1864,
284,
37674,
87,
23906,
4676,
6323,
11,
475,
534,
6323,
318,
4064,
34350,
4,
67,
11,
428,
743,
393,
743,
407,
2728,
2761,
1,
4064,
357,
54,
11,
367,
4008,
198,
198,
8043,
62,
11186,
796,
357,
13381,
11,
14280,
11,
14280,
8,
198,
8043,
62,
36022,
796,
357,
15,
11,
14280,
11,
14280,
8,
198,
8043,
62,
445,
796,
357,
15,
11,
657,
11,
14280,
8,
198,
8043,
62,
43745,
796,
357,
15,
11,
25090,
11,
14280,
8,
198,
8043,
62,
14809,
796,
357,
15,
11,
14280,
11,
657,
8,
198,
8043,
62,
17585,
796,
357,
13381,
11,
657,
11,
657,
8,
198,
198,
4514,
6407,
25,
198,
220,
220,
220,
318,
17821,
11,
8246,
796,
12172,
13,
961,
3419,
198,
220,
220,
220,
611,
318,
17821,
6624,
10352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
628,
220,
220,
220,
8246,
796,
269,
85,
13,
2704,
541,
7,
1831,
11,
352,
8,
628,
220,
220,
220,
611,
717,
45677,
6624,
10352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
2554,
9248,
7,
1831,
11,
357,
15,
11,
367,
12,
1821,
828,
357,
54,
11,
367,
828,
357,
2816,
11,
5996,
11,
5996,
828,
532,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
1996,
8206,
7,
1831,
11,
366,
15307,
530,
5228,
286,
262,
23441,
284,
262,
4676,
11,
1195,
284,
8420,
1600,
357,
940,
11,
367,
12,
1065,
828,
269,
85,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
48913,
16437,
55,
11,
352,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
45597,
7,
1831,
11,
357,
1821,
11,
367,
12,
1120,
828,
1802,
11,
357,
13381,
11,
14280,
11,
14280,
828,
532,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
1370,
7,
1831,
11,
357,
1821,
11,
367,
12,
1120,
828,
357,
3064,
11,
367,
12,
11442,
828,
357,
15,
11,
6640,
11,
657,
828,
838,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
1370,
7,
1831,
11,
357,
940,
11,
367,
12,
1795,
828,
357,
1821,
11,
367,
12,
1120,
828,
357,
15,
11,
6640,
11,
657,
828,
838,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
2554,
9248,
7,
1831,
11,
357,
15,
11,
367,
12,
1821,
828,
357,
54,
11,
367,
828,
357,
2816,
11,
5996,
11,
5996,
828,
532,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
1996,
8206,
7,
1831,
11,
366,
3844,
905,
262,
6697,
5228,
284,
262,
4676,
11,
1195,
284,
8420,
1600,
357,
940,
11,
367,
12,
1065,
828,
269,
85,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
48913,
16437,
55,
11,
352,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
628,
220,
220,
220,
1303,
9,
460,
3281,
5743,
13326,
198,
220,
220,
220,
23671,
796,
269,
85,
13,
1150,
666,
3629,
333,
7,
1831,
11,
767,
8,
198,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
34,
7737,
7,
2436,
333,
11,
2026,
11,
6640,
8,
198,
220,
220,
220,
21976,
62,
533,
292,
796,
460,
3281,
13,
30073,
3419,
198,
220,
220,
220,
460,
3281,
62,
44605,
796,
460,
3281,
13,
30073,
3419,
198,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
33967,
83,
10258,
7,
66,
7737,
11,
269,
85,
13,
46786,
62,
38,
30631,
17,
33,
10761,
8,
628,
220,
220,
220,
1303,
9,
15315,
23441,
18328,
198,
220,
220,
220,
43344,
796,
45941,
13,
18747,
26933,
198,
220,
220,
220,
220,
220,
220,
220,
685,
36879,
11,
12279,
4357,
220,
198,
220,
220,
220,
220,
220,
220,
220,
685,
44230,
11,
939,
4357,
220,
198,
220,
220,
220,
220,
220,
220,
220,
685,
45432,
11,
45063,
4357,
220,
198,
220,
220,
220,
220,
220,
220,
220,
685,
42444,
11,
642,
4869,
4357,
220,
198,
220,
220,
220,
220,
220,
220,
220,
685,
31503,
11,
604,
2682,
4357,
220,
198,
220,
220,
220,
220,
220,
220,
220,
685,
34229,
11,
28714,
60,
198,
220,
220,
220,
220,
220,
220,
220,
16589,
45941,
13,
600,
2624,
8,
198,
220,
220,
220,
43344,
13,
3447,
1758,
19510,
12,
16,
11,
352,
11,
362,
4008,
198,
220,
220,
220,
611,
16959,
25,
198,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
35428,
6615,
7,
66,
7737,
11,
685,
457,
82,
4357,
6407,
11,
357,
15,
11,
14280,
11,
657,
828,
513,
8,
198,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
357,
42444,
11,
44341,
828,
1542,
11,
357,
15,
11,
657,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
357,
42444,
11,
44341,
828,
2026,
11,
357,
15,
11,
657,
11,
14280,
4008,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
35428,
6615,
7,
1831,
11,
685,
457,
82,
4357,
6407,
11,
357,
15,
11,
14280,
11,
657,
828,
513,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
1370,
7,
1831,
11,
357,
44230,
11,
939,
828,
357,
42444,
11,
44341,
828,
357,
15,
11,
14280,
11,
657,
828,
513,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
1370,
7,
1831,
11,
357,
42444,
11,
642,
4869,
828,
357,
42444,
11,
44341,
828,
357,
15,
11,
14280,
11,
657,
828,
513,
8,
198,
220,
220,
220,
220,
220,
220,
220,
8246,
796,
269,
85,
13,
1370,
7,
1831,
11,
357,
34229,
11,
28714,
828,
357,
42444,
11,
44341,
828,
357,
15,
11,
14280,
11,
657,
828,
513,
8,
198,
220,
220,
220,
23441,
62,
20337,
796,
1989,
7,
457,
82,
8,
628,
220,
220,
220,
1303,
9,
15315,
734,
13332,
19254,
379,
262,
5228,
11,
1064,
16246,
2173,
351,
13015,
198,
220,
220,
220,
1310,
62,
45597,
62,
13033,
796,
17635,
198,
220,
220,
220,
1263,
62,
45597,
62,
13033,
796,
17635,
198,
220,
220,
220,
2173,
796,
269,
85,
13,
695,
541,
325,
17,
34220,
19510,
42444,
11,
44341,
828,
357,
1270,
11,
1542,
828,
657,
11,
657,
11,
11470,
11,
352,
8,
198,
220,
220,
220,
329,
357,
87,
11,
331,
8,
287,
2173,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
460,
3281,
62,
44605,
58,
88,
11,
2124,
60,
6624,
14280,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
31629,
62,
45597,
62,
13033,
8,
6624,
657,
393,
5253,
19510,
87,
11,
331,
828,
1310,
62,
45597,
62,
13033,
58,
12,
16,
12962,
1875,
1542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1310,
62,
45597,
62,
13033,
13,
33295,
19510,
87,
11,
331,
4008,
198,
220,
220,
220,
2173,
796,
269,
85,
13,
695,
541,
325,
17,
34220,
19510,
42444,
11,
44341,
828,
357,
1120,
11,
2026,
828,
657,
11,
657,
11,
11470,
11,
352,
8,
198,
220,
220,
220,
329,
357,
87,
11,
331,
8,
287,
2173,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
460,
3281,
62,
44605,
58,
88,
11,
2124,
60,
6624,
14280,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
14261,
62,
45597,
62,
13033,
8,
6624,
657,
393,
5253,
19510,
87,
11,
331,
828,
1263,
62,
45597,
62,
13033,
58,
12,
16,
12962,
1875,
1542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1263,
62,
45597,
62,
13033,
13,
33295,
19510,
87,
11,
331,
4008,
628,
220,
220,
220,
477,
62,
276,
3212,
62,
9275,
796,
10352,
198,
220,
220,
220,
611,
18896,
7,
31629,
62,
45597,
62,
13033,
8,
1875,
657,
290,
18896,
7,
14261,
62,
45597,
62,
13033,
8,
1875,
657,
290,
5253,
7,
31629,
62,
45597,
62,
13033,
58,
15,
4357,
1263,
62,
45597,
62,
13033,
58,
15,
12962,
1279,
2534,
25,
198,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
1370,
7,
66,
7737,
11,
1310,
62,
45597,
62,
13033,
58,
15,
4357,
1263,
62,
45597,
62,
13033,
58,
15,
4357,
357,
15,
11,
14280,
11,
657,
828,
362,
8,
198,
220,
220,
220,
611,
18896,
7,
31629,
62,
45597,
62,
13033,
8,
1875,
352,
290,
18896,
7,
14261,
62,
45597,
62,
13033,
8,
1875,
352,
290,
5253,
7,
31629,
62,
45597,
62,
13033,
58,
16,
4357,
1263,
62,
45597,
62,
13033,
58,
16,
12962,
1279,
2534,
25,
198,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
1370,
7,
66,
7737,
11,
1310,
62,
45597,
62,
13033,
58,
16,
4357,
1263,
62,
45597,
62,
13033,
58,
16,
4357,
357,
15,
11,
14280,
11,
657,
828,
362,
8,
198,
220,
220,
220,
611,
18896,
7,
31629,
62,
45597,
62,
13033,
8,
1875,
362,
290,
18896,
7,
14261,
62,
45597,
62,
13033,
8,
1875,
362,
290,
5253,
7,
31629,
62,
45597,
62,
13033,
58,
17,
4357,
1263,
62,
45597,
62,
13033,
58,
17,
12962,
1279,
2534,
25,
198,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
1370,
7,
66,
7737,
11,
1310,
62,
45597,
62,
13033,
58,
17,
4357,
1263,
62,
45597,
62,
13033,
58,
17,
4357,
357,
15,
11,
14280,
11,
657,
828,
362,
8,
198,
220,
220,
220,
220,
220,
220,
220,
477,
62,
276,
3212,
62,
9275,
796,
6407,
628,
220,
220,
220,
611,
477,
62,
276,
3212,
62,
9275,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
1439,
1043,
2173,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
16,
11,
331,
16,
796,
1310,
62,
45597,
62,
13033,
58,
15,
7131,
15,
60,
1343,
304,
862,
11,
1310,
62,
45597,
62,
13033,
58,
15,
7131,
16,
60,
1343,
304,
862,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
17,
11,
331,
17,
796,
1263,
62,
45597,
62,
13033,
58,
15,
7131,
15,
4357,
1263,
62,
45597,
62,
13033,
58,
15,
7131,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
18,
11,
331,
18,
796,
1310,
62,
45597,
62,
13033,
58,
16,
7131,
15,
60,
1343,
304,
862,
11,
1310,
62,
45597,
62,
13033,
58,
16,
7131,
16,
60,
1343,
304,
862,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
19,
11,
331,
19,
796,
1263,
62,
45597,
62,
13033,
58,
16,
7131,
15,
4357,
1263,
62,
45597,
62,
13033,
58,
16,
7131,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
20,
11,
331,
20,
796,
1310,
62,
45597,
62,
13033,
58,
17,
7131,
15,
60,
1343,
304,
862,
11,
1310,
62,
45597,
62,
13033,
58,
17,
7131,
16,
60,
1343,
304,
862,
198,
220,
220,
220,
220,
220,
220,
220,
2124,
21,
11,
331,
21,
796,
1263,
62,
45597,
62,
13033,
58,
17,
7131,
15,
4357,
1263,
62,
45597,
62,
13033,
58,
17,
7131,
16,
60,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
9938,
3504,
5228,
198,
220,
220,
220,
220,
220,
220,
220,
16488,
16,
11,
3641,
62,
88,
16,
796,
16246,
7,
87,
16,
11,
331,
16,
11,
2124,
17,
11,
331,
17,
11,
2124,
18,
11,
331,
18,
11,
2124,
19,
11,
331,
19,
8,
198,
220,
220,
220,
220,
220,
220,
220,
16488,
17,
11,
3641,
62,
88,
17,
796,
16246,
7,
87,
18,
11,
331,
18,
11,
2124,
19,
11,
331,
19,
11,
2124,
20,
11,
331,
20,
11,
2124,
21,
11,
331,
21,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3641,
62,
87,
18,
11,
3641,
62,
88,
18,
796,
16246,
7,
87,
20,
11,
331,
20,
11,
2124,
21,
11,
331,
21,
11,
2124,
16,
11,
331,
16,
11,
2124,
17,
11,
331,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3641,
62,
87,
11,
3641,
62,
88,
796,
357,
22704,
16,
1343,
16488,
17,
1343,
3641,
62,
87,
18,
20679,
18,
11,
357,
16159,
62,
88,
16,
1343,
3641,
62,
88,
17,
1343,
3641,
62,
88,
18,
20679,
18,
198,
220,
220,
220,
220,
220,
220,
220,
3641,
796,
493,
7,
16159,
62,
87,
828,
493,
7,
16159,
62,
88,
8,
198,
220,
220,
220,
220,
220,
220,
220,
611,
3641,
62,
87,
1875,
1802,
830,
393,
3641,
62,
88,
1875,
1802,
830,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
220,
220,
220,
220,
611,
16959,
290,
657,
1279,
3641,
62,
87,
1279,
8576,
290,
657,
1279,
3641,
62,
88,
1279,
8576,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
3641,
11,
642,
11,
357,
13381,
11,
14280,
11,
657,
828,
532,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
9938,
14371,
1474,
3504,
5228,
198,
220,
220,
220,
220,
220,
220,
220,
11844,
515,
62,
276,
3212,
796,
269,
85,
13,
67,
346,
378,
7,
66,
7737,
11,
45941,
13,
1952,
19510,
940,
11,
838,
828,
45941,
13,
28611,
23,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
44332,
11,
20268,
796,
1263,
62,
45597,
62,
13033,
58,
15,
7131,
15,
60,
532,
1310,
62,
45597,
62,
13033,
58,
15,
7131,
15,
4357,
1263,
62,
45597,
62,
13033,
58,
15,
7131,
16,
60,
532,
1310,
62,
45597,
62,
13033,
58,
15,
7131,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
44332,
11,
20268,
796,
44332,
14,
13664,
19510,
34350,
11,
20268,
36911,
20268,
14,
13664,
19510,
34350,
11,
20268,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
16,
62,
87,
11,
5228,
16,
62,
88,
796,
3641,
62,
87,
1343,
44332,
9,
2167,
11,
3641,
62,
88,
1343,
20268,
9,
2167,
198,
220,
220,
220,
220,
220,
220,
220,
981,
657,
1279,
5228,
16,
62,
87,
1279,
370,
290,
657,
1279,
5228,
16,
62,
88,
1279,
367,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
11844,
515,
62,
276,
3212,
58,
600,
7,
10215,
1008,
16,
62,
88,
828,
493,
7,
10215,
1008,
16,
62,
87,
25295,
439,
3419,
6624,
657,
25,
198,
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,
5228,
16,
62,
87,
15853,
44332,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5228,
16,
62,
88,
15853,
20268,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
16,
62,
87,
48185,
642,
9,
34350,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
16,
62,
88,
48185,
642,
9,
9892,
628,
220,
220,
220,
220,
220,
220,
220,
44332,
11,
20268,
796,
1263,
62,
45597,
62,
13033,
58,
16,
7131,
15,
60,
532,
1310,
62,
45597,
62,
13033,
58,
16,
7131,
15,
4357,
1263,
62,
45597,
62,
13033,
58,
16,
7131,
16,
60,
532,
1310,
62,
45597,
62,
13033,
58,
16,
7131,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
44332,
11,
20268,
796,
44332,
14,
13664,
19510,
34350,
11,
20268,
36911,
20268,
14,
13664,
19510,
34350,
11,
20268,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
17,
62,
87,
11,
5228,
17,
62,
88,
796,
3641,
62,
87,
1343,
44332,
9,
2167,
11,
3641,
62,
88,
1343,
20268,
9,
2167,
198,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
357,
600,
7,
10215,
1008,
17,
62,
87,
828,
493,
7,
10215,
1008,
17,
62,
88,
36911,
838,
11,
357,
15,
11,
657,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
981,
657,
1279,
5228,
17,
62,
87,
1279,
370,
290,
657,
1279,
5228,
17,
62,
88,
1279,
367,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
11844,
515,
62,
276,
3212,
58,
600,
7,
10215,
1008,
17,
62,
88,
828,
493,
7,
10215,
1008,
17,
62,
87,
25295,
439,
3419,
6624,
657,
25,
198,
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,
5228,
17,
62,
87,
15853,
44332,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5228,
17,
62,
88,
15853,
20268,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
17,
62,
87,
48185,
642,
9,
34350,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
17,
62,
88,
48185,
642,
9,
9892,
628,
220,
220,
220,
220,
220,
220,
220,
44332,
11,
20268,
796,
1263,
62,
45597,
62,
13033,
58,
17,
7131,
15,
60,
532,
1310,
62,
45597,
62,
13033,
58,
17,
7131,
15,
4357,
1263,
62,
45597,
62,
13033,
58,
17,
7131,
16,
60,
532,
1310,
62,
45597,
62,
13033,
58,
17,
7131,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
44332,
11,
20268,
796,
44332,
14,
13664,
19510,
34350,
11,
20268,
36911,
20268,
14,
13664,
19510,
34350,
11,
20268,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
18,
62,
87,
11,
5228,
18,
62,
88,
796,
3641,
62,
87,
1343,
44332,
9,
2167,
11,
3641,
62,
88,
1343,
20268,
9,
2167,
198,
220,
220,
220,
220,
220,
220,
220,
981,
657,
1279,
5228,
18,
62,
87,
1279,
370,
290,
657,
1279,
5228,
18,
62,
88,
1279,
367,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
11844,
515,
62,
276,
3212,
58,
600,
7,
10215,
1008,
18,
62,
88,
828,
493,
7,
10215,
1008,
18,
62,
87,
25295,
439,
3419,
6624,
657,
25,
198,
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,
5228,
18,
62,
87,
15853,
44332,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5228,
18,
62,
88,
15853,
20268,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
18,
62,
87,
48185,
642,
9,
34350,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
18,
62,
88,
48185,
642,
9,
9892,
628,
220,
220,
220,
220,
220,
220,
220,
5228,
16,
796,
357,
600,
7,
10215,
1008,
16,
62,
87,
828,
493,
7,
10215,
1008,
16,
62,
88,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
17,
796,
357,
600,
7,
10215,
1008,
17,
62,
87,
828,
493,
7,
10215,
1008,
17,
62,
88,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
5228,
18,
796,
357,
600,
7,
10215,
1008,
18,
62,
87,
828,
493,
7,
10215,
1008,
18,
62,
88,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
611,
16959,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
5228,
16,
11,
838,
11,
357,
15,
11,
657,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
5228,
17,
11,
838,
11,
357,
15,
11,
657,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
5228,
18,
11,
838,
11,
357,
15,
11,
657,
11,
14280,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
10062,
1920,
584,
14371,
198,
220,
220,
220,
220,
220,
220,
220,
1290,
62,
10215,
1008,
16,
796,
5556,
7,
40191,
7,
10215,
1008,
16,
11,
3641,
828,
5228,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1290,
62,
10215,
1008,
17,
796,
5556,
7,
40191,
7,
10215,
1008,
17,
11,
3641,
828,
5228,
18,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1290,
62,
10215,
1008,
18,
796,
5556,
7,
40191,
7,
10215,
1008,
18,
11,
3641,
828,
5228,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1290,
62,
10215,
1008,
16,
796,
20208,
7,
16370,
62,
10215,
1008,
16,
11,
1661,
7,
15,
13,
1485,
11,
20208,
7,
16370,
62,
10215,
1008,
16,
11,
3641,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
1290,
62,
10215,
1008,
17,
796,
20208,
7,
16370,
62,
10215,
1008,
17,
11,
1661,
7,
15,
13,
1485,
11,
20208,
7,
16370,
62,
10215,
1008,
17,
11,
3641,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
1290,
62,
10215,
1008,
18,
796,
20208,
7,
16370,
62,
10215,
1008,
18,
11,
1661,
7,
15,
13,
1485,
11,
20208,
7,
16370,
62,
10215,
1008,
18,
11,
3641,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
1290,
62,
10215,
1008,
16,
796,
357,
600,
7,
16370,
62,
10215,
1008,
16,
58,
15,
46570,
493,
7,
16370,
62,
10215,
1008,
16,
58,
16,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1290,
62,
10215,
1008,
17,
796,
357,
600,
7,
16370,
62,
10215,
1008,
17,
58,
15,
46570,
493,
7,
16370,
62,
10215,
1008,
17,
58,
16,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1290,
62,
10215,
1008,
18,
796,
357,
600,
7,
16370,
62,
10215,
1008,
18,
58,
15,
46570,
493,
7,
16370,
62,
10215,
1008,
18,
58,
16,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
6822,
611,
10488,
1989,
290,
18328,
1989,
7466,
198,
220,
220,
220,
220,
220,
220,
220,
23993,
796,
10352,
198,
220,
220,
220,
220,
220,
220,
220,
10488,
62,
20337,
796,
1989,
26933,
10215,
1008,
16,
11,
1290,
62,
10215,
1008,
16,
11,
5228,
17,
11,
1290,
62,
10215,
1008,
17,
11,
5228,
18,
11,
1290,
62,
10215,
1008,
18,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
796,
2352,
7,
9948,
49262,
62,
20337,
532,
23441,
62,
20337,
20679,
40296,
62,
20337,
198,
220,
220,
220,
220,
220,
220,
220,
611,
4049,
1279,
657,
13,
16,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
16959,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
1290,
62,
10215,
1008,
16,
11,
838,
11,
357,
15,
11,
657,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
1290,
62,
10215,
1008,
17,
11,
838,
11,
357,
15,
11,
657,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
45597,
7,
66,
7737,
11,
1290,
62,
10215,
1008,
18,
11,
838,
11,
357,
15,
11,
657,
11,
14280,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21976,
62,
533,
292,
796,
269,
85,
13,
45597,
7,
35836,
768,
62,
533,
292,
11,
5228,
16,
11,
838,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21976,
62,
533,
292,
796,
269,
85,
13,
45597,
7,
35836,
768,
62,
533,
292,
11,
5228,
17,
11,
838,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21976,
62,
533,
292,
796,
269,
85,
13,
45597,
7,
35836,
768,
62,
533,
292,
11,
5228,
18,
11,
838,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21976,
62,
533,
292,
796,
269,
85,
13,
45597,
7,
35836,
768,
62,
533,
292,
11,
1290,
62,
10215,
1008,
16,
11,
838,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21976,
62,
533,
292,
796,
269,
85,
13,
45597,
7,
35836,
768,
62,
533,
292,
11,
1290,
62,
10215,
1008,
17,
11,
838,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21976,
62,
533,
292,
796,
269,
85,
13,
45597,
7,
35836,
768,
62,
533,
292,
11,
1290,
62,
10215,
1008,
18,
11,
838,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
46894,
6698,
290,
7925,
7577,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1100,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
6698,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
6698,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16488,
16,
796,
20208,
7,
10215,
1008,
16,
11,
3641,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16488,
17,
796,
20208,
7,
10215,
1008,
17,
11,
3641,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
6698,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16488,
16,
796,
20208,
7,
10215,
1008,
17,
11,
3641,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16488,
17,
796,
20208,
7,
10215,
1008,
18,
11,
3641,
8,
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,
16488,
16,
796,
20208,
7,
10215,
1008,
18,
11,
3641,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16488,
17,
796,
20208,
7,
10215,
1008,
16,
11,
3641,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
10215,
1008,
16,
796,
5556,
7,
16159,
11,
5556,
7,
22355,
7,
1312,
220,
220,
1220,
18,
11,
16488,
16,
828,
1661,
7,
474,
220,
220,
1220,
18,
11,
16488,
17,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
10215,
1008,
17,
796,
5556,
7,
16159,
11,
5556,
7,
22355,
19510,
72,
10,
16,
20679,
18,
11,
16488,
16,
828,
1661,
7,
474,
220,
220,
1220,
18,
11,
16488,
17,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
10215,
1008,
18,
796,
5556,
7,
16159,
11,
5556,
7,
22355,
7,
1312,
220,
220,
1220,
18,
11,
16488,
16,
828,
1661,
19510,
73,
10,
16,
20679,
18,
11,
16488,
17,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
10215,
1008,
19,
796,
5556,
7,
16159,
11,
5556,
7,
22355,
19510,
72,
10,
16,
20679,
18,
11,
16488,
16,
828,
1661,
19510,
73,
10,
16,
20679,
18,
11,
16488,
17,
22305,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
10215,
1008,
16,
796,
20208,
7,
12239,
62,
10215,
1008,
16,
11,
1661,
7,
15,
13,
1485,
9,
1084,
7,
72,
220,
837,
474,
220,
1267,
14,
18,
11,
20208,
7,
12239,
62,
10215,
1008,
16,
11,
3641,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
10215,
1008,
17,
796,
20208,
7,
12239,
62,
10215,
1008,
17,
11,
1661,
7,
15,
13,
1485,
9,
1084,
7,
72,
10,
16,
11,
474,
220,
1267,
14,
18,
11,
20208,
7,
12239,
62,
10215,
1008,
17,
11,
3641,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
10215,
1008,
18,
796,
20208,
7,
12239,
62,
10215,
1008,
18,
11,
1661,
7,
15,
13,
1485,
9,
1084,
7,
72,
220,
837,
474,
10,
16,
20679,
18,
11,
20208,
7,
12239,
62,
10215,
1008,
18,
11,
3641,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
10215,
1008,
19,
796,
20208,
7,
12239,
62,
10215,
1008,
19,
11,
1661,
7,
15,
13,
1485,
9,
1084,
7,
72,
10,
16,
11,
474,
10,
16,
20679,
18,
11,
20208,
7,
12239,
62,
10215,
1008,
19,
11,
3641,
22305,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
27932,
796,
45941,
13,
9107,
418,
19510,
66,
7737,
13,
43358,
58,
15,
4357,
460,
3281,
13,
43358,
58,
16,
46570,
45941,
13,
28611,
23,
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,
43344,
796,
45941,
13,
18747,
26933,
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,
685,
12239,
62,
10215,
1008,
16,
58,
15,
4357,
3704,
62,
10215,
1008,
16,
58,
16,
60,
4357,
220,
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,
685,
12239,
62,
10215,
1008,
17,
58,
15,
4357,
3704,
62,
10215,
1008,
17,
58,
16,
60,
4357,
220,
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,
685,
12239,
62,
10215,
1008,
19,
58,
15,
4357,
3704,
62,
10215,
1008,
19,
58,
16,
60,
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,
685,
12239,
62,
10215,
1008,
18,
58,
15,
4357,
3704,
62,
10215,
1008,
18,
58,
16,
11907,
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,
16589,
45941,
13,
600,
2624,
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,
43344,
13,
3447,
1758,
19510,
12,
16,
11,
352,
11,
362,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
27932,
796,
269,
85,
13,
20797,
34220,
7,
12239,
62,
27932,
11,
685,
457,
82,
4357,
357,
13381,
11,
14280,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3704,
62,
27932,
796,
269,
85,
13,
263,
1098,
7,
12239,
62,
27932,
11,
45941,
13,
1952,
19510,
2327,
11,
2327,
828,
45941,
13,
28611,
23,
4008,
1303,
1931,
1098,
284,
2948,
1310,
2984,
489,
28613,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21976,
62,
533,
292,
796,
269,
85,
13,
2545,
3083,
62,
273,
7,
35836,
768,
62,
533,
292,
11,
3704,
62,
27932,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
8820,
434,
329,
2440,
9922,
475,
1327,
2872,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5743,
62,
9122,
796,
269,
85,
13,
32604,
7,
66,
7737,
11,
3704,
62,
27932,
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,
1303,
611,
5743,
62,
9122,
58,
15,
60,
1875,
657,
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,
1303,
220,
220,
220,
220,
25776,
76,
9189,
796,
6407,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
1002,
3124,
10868,
1989,
318,
523,
1402,
11,
13703,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23441,
62,
20337,
796,
269,
85,
13,
32604,
7,
12239,
62,
27932,
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,
611,
23441,
62,
20337,
58,
15,
60,
1279,
657,
13,
22544,
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,
220,
220,
220,
220,
23993,
796,
6407,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1100,
62,
8043,
796,
269,
85,
13,
32604,
7,
1831,
11,
3704,
62,
27932,
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,
611,
16959,
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,
220,
220,
220,
220,
460,
3281,
796,
269,
85,
13,
20797,
34220,
7,
66,
7737,
11,
685,
457,
82,
4357,
357,
600,
7,
961,
62,
8043,
58,
15,
46570,
493,
7,
961,
62,
8043,
58,
16,
46570,
493,
7,
961,
62,
8043,
58,
17,
60,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1100,
13,
33295,
19510,
961,
62,
8043,
58,
15,
4357,
1100,
62,
8043,
58,
16,
4357,
1100,
62,
8043,
58,
17,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
16959,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
13,
320,
12860,
10786,
35836,
768,
62,
533,
292,
3256,
21976,
62,
533,
292,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
23993,
25,
198,
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,
611,
407,
717,
5569,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
717,
5569,
796,
1100,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
717,
45677,
796,
6407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
16959,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
13,
320,
12860,
10786,
11085,
1100,
3256,
460,
3281,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
13,
320,
12860,
10786,
11085,
1100,
8246,
3256,
8246,
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,
3580,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
11925,
7,
961,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3580,
15853,
357,
11085,
5569,
58,
72,
7131,
73,
60,
532,
1100,
58,
72,
7131,
73,
12962,
1174,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3580,
1875,
2681,
2388,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1218,
5569,
796,
1100,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9743,
796,
717,
5569,
1343,
1218,
5569,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
16959,
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,
269,
85,
13,
320,
12860,
10786,
1134,
259,
979,
12876,
7487,
3256,
460,
3281,
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,
269,
85,
13,
320,
12860,
10786,
1134,
259,
979,
12876,
7487,
8246,
3256,
8246,
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,
3601,
7,
40779,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
45559,
3810,
543,
3124,
543,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3124,
62,
24432,
796,
16410,
4357,
685,
4357,
685,
4357,
685,
4357,
685,
4357,
685,
11907,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9743,
796,
1210,
7998,
53,
7,
40779,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3274,
860,
1551,
24725,
3124,
318,
2330,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9743,
796,
9743,
58,
40779,
58,
45299,
16,
4083,
22046,
419,
3419,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
24,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3124,
62,
24432,
58,
15,
4083,
33295,
7,
600,
7,
40779,
58,
72,
7131,
18,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9743,
796,
9743,
58,
24,
47715,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3819,
7577,
389,
5295,
1864,
284,
511,
37409,
1988,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9743,
796,
9743,
58,
40779,
58,
45299,
15,
4083,
22046,
419,
3419,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
16,
11,
718,
2599,
198,
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,
24,
2599,
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,
3124,
62,
24432,
58,
73,
4083,
33295,
7,
600,
7,
40779,
58,
7,
73,
12,
16,
27493,
24,
1343,
1312,
7131,
18,
60,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
810,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
4051,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
810,
13,
33295,
32590,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
21,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
24,
2599,
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,
810,
58,
8043,
62,
24432,
58,
72,
7131,
73,
11907,
796,
1312,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23441,
62,
4868,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
4051,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23441,
62,
4868,
13,
33295,
32590,
16,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
9938,
4113,
286,
5207,
290,
6070,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
7,
40296,
62,
4868,
11,
810,
58,
15,
25,
24,
4357,
810,
58,
1485,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
7,
40296,
62,
4868,
11,
810,
58,
24,
25,
1507,
4357,
810,
58,
1828,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
7,
40296,
62,
4868,
11,
810,
58,
1507,
25,
1983,
4357,
810,
58,
19,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
7,
40296,
62,
4868,
11,
810,
58,
1983,
25,
2623,
4357,
810,
58,
1821,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
7,
40296,
62,
4868,
11,
810,
58,
2623,
25,
2231,
4357,
810,
58,
2920,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6070,
7,
40296,
62,
4868,
11,
810,
58,
2231,
25,
4051,
4357,
810,
58,
3132,
12962,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
9,
13610,
1255,
2939,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
45941,
13,
9107,
418,
19510,
39,
11,
370,
11,
513,
828,
45941,
13,
28611,
23,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
384,
525,
1352,
817,
624,
1108,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
18,
2599,
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,
279,
87,
796,
838,
1343,
6640,
1343,
838,
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,
12972,
796,
838,
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,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
1312,
9,
1120,
11,
12972,
1343,
474,
9,
1120,
828,
357,
8416,
1343,
357,
72,
10,
16,
27493,
1120,
11,
12972,
1343,
357,
73,
10,
16,
27493,
1120,
828,
651,
8043,
7,
40296,
62,
4868,
58,
72,
10,
73,
9,
18,
46570,
532,
16,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
828,
357,
8416,
1343,
1802,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
2026,
11,
12972,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
1343,
2026,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
1802,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
18,
2599,
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,
279,
87,
796,
838,
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,
12972,
796,
838,
1343,
6640,
1343,
838,
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,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
1312,
9,
1120,
11,
12972,
1343,
474,
9,
1120,
828,
357,
8416,
1343,
357,
72,
10,
16,
27493,
1120,
11,
12972,
1343,
357,
73,
10,
16,
27493,
1120,
828,
651,
8043,
7,
40296,
62,
4868,
58,
24,
10,
72,
10,
73,
9,
18,
46570,
532,
16,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
828,
357,
8416,
1343,
1802,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
2026,
11,
12972,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
1343,
2026,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
1802,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
18,
2599,
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,
279,
87,
796,
838,
1343,
6640,
1343,
838,
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,
12972,
796,
838,
1343,
6640,
1343,
838,
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,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
1312,
9,
1120,
11,
12972,
1343,
474,
9,
1120,
828,
357,
8416,
1343,
357,
72,
10,
16,
27493,
1120,
11,
12972,
1343,
357,
73,
10,
16,
27493,
1120,
828,
651,
8043,
7,
40296,
62,
4868,
58,
1507,
10,
72,
10,
73,
9,
18,
46570,
532,
16,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
828,
357,
8416,
1343,
1802,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
2026,
11,
12972,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
1343,
2026,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
1802,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
18,
2599,
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,
279,
87,
796,
838,
1343,
6640,
1343,
838,
1343,
6640,
1343,
838,
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,
12972,
796,
838,
1343,
6640,
1343,
838,
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,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
1312,
9,
1120,
11,
12972,
1343,
474,
9,
1120,
828,
357,
8416,
1343,
357,
72,
10,
16,
27493,
1120,
11,
12972,
1343,
357,
73,
10,
16,
27493,
1120,
828,
651,
8043,
7,
40296,
62,
4868,
58,
1983,
10,
72,
10,
73,
9,
18,
46570,
532,
16,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
828,
357,
8416,
1343,
1802,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
2026,
11,
12972,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
1343,
2026,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
1802,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
18,
2599,
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,
279,
87,
796,
838,
1343,
6640,
1343,
838,
1343,
6640,
1343,
838,
1343,
6640,
1343,
838,
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,
12972,
796,
838,
1343,
6640,
1343,
838,
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,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
1312,
9,
1120,
11,
12972,
1343,
474,
9,
1120,
828,
357,
8416,
1343,
357,
72,
10,
16,
27493,
1120,
11,
12972,
1343,
357,
73,
10,
16,
27493,
1120,
828,
651,
8043,
7,
40296,
62,
4868,
58,
2623,
10,
72,
10,
73,
9,
18,
46570,
532,
16,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
828,
357,
8416,
1343,
1802,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
2026,
11,
12972,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
1343,
2026,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
1802,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
18,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
18,
2599,
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,
279,
87,
796,
838,
1343,
6640,
1343,
838,
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,
12972,
796,
838,
1343,
6640,
1343,
838,
1343,
6640,
1343,
838,
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,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
1312,
9,
1120,
11,
12972,
1343,
474,
9,
1120,
828,
357,
8416,
1343,
357,
72,
10,
16,
27493,
1120,
11,
12972,
1343,
357,
73,
10,
16,
27493,
1120,
828,
651,
8043,
7,
40296,
62,
4868,
58,
2231,
10,
72,
10,
73,
9,
18,
46570,
532,
16,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
828,
357,
8416,
1343,
1802,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
1343,
2026,
11,
12972,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
6640,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
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,
220,
220,
220,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
8416,
11,
12972,
1343,
2026,
828,
357,
8416,
1343,
6640,
11,
12972,
1343,
1802,
828,
357,
15,
11,
657,
11,
657,
828,
384,
525,
1352,
817,
624,
1108,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
1733,
368,
7012,
62,
15414,
62,
7635,
796,
23441,
62,
4868,
58,
15,
25,
24,
60,
1343,
23441,
62,
4868,
58,
1983,
25,
2623,
60,
1343,
23441,
62,
4868,
58,
1507,
25,
1983,
60,
1343,
23441,
62,
4868,
58,
2231,
25,
4051,
60,
1343,
23441,
62,
4868,
58,
24,
25,
1507,
60,
1343,
23441,
62,
4868,
58,
2623,
25,
2231,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
1733,
368,
7012,
62,
5239,
796,
965,
7,
74,
1733,
368,
7012,
62,
15414,
62,
7635,
737,
33491,
10786,
58,
3256,
10148,
737,
33491,
10786,
60,
3256,
10148,
737,
33491,
7,
3256,
3256,
10148,
737,
33491,
10786,
46083,
10148,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
1733,
368,
7012,
62,
5239,
796,
479,
1733,
368,
7012,
62,
5239,
13,
33491,
10786,
15,
3256,
705,
52,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
1733,
368,
7012,
62,
5239,
796,
479,
1733,
368,
7012,
62,
5239,
13,
33491,
10786,
16,
3256,
705,
33,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
1733,
368,
7012,
62,
5239,
796,
479,
1733,
368,
7012,
62,
5239,
13,
33491,
10786,
17,
3256,
705,
37,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
1733,
368,
7012,
62,
5239,
796,
479,
1733,
368,
7012,
62,
5239,
13,
33491,
10786,
18,
3256,
705,
35,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
1733,
368,
7012,
62,
5239,
796,
479,
1733,
368,
7012,
62,
5239,
13,
33491,
10786,
19,
3256,
705,
49,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
479,
1733,
368,
7012,
62,
5239,
796,
479,
1733,
368,
7012,
62,
5239,
13,
33491,
10786,
20,
3256,
705,
43,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4610,
796,
13538,
198,
220,
220,
220,
220,
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,
220,
220,
220,
220,
4610,
796,
479,
1733,
368,
7012,
13,
82,
6442,
7,
74,
1733,
368,
7012,
62,
5239,
8,
198,
220,
220,
220,
220,
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,
220,
220,
220,
220,
4610,
796,
366,
14385,
11,
428,
23441,
2314,
307,
16019,
13,
9993,
757,
1,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
1996,
8206,
7,
20274,
11,
366,
12256,
319,
1353,
11,
11942,
287,
2166,
1600,
357,
940,
11,
36141,
828,
269,
85,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
48913,
16437,
55,
11,
352,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
1996,
8206,
7,
20274,
11,
4610,
11,
357,
940,
11,
38089,
828,
269,
85,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
48913,
16437,
55,
11,
352,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
1996,
8206,
7,
20274,
11,
366,
49,
284,
1005,
563,
11,
1195,
284,
11238,
1600,
357,
940,
11,
10053,
828,
269,
85,
13,
37,
35830,
62,
39,
4877,
13909,
56,
62,
48913,
16437,
55,
11,
352,
11,
357,
13381,
11,
14280,
11,
14280,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44332,
796,
357,
54,
532,
22626,
8,
3373,
718,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20268,
796,
5323,
3373,
604,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4610,
58,
15,
60,
14512,
705,
50,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4610,
62,
18747,
796,
4610,
13,
35312,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
474,
287,
2837,
7,
19,
2599,
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,
329,
1312,
287,
2837,
7,
21,
2599,
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,
1271,
796,
474,
9,
21,
1343,
1312,
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,
611,
18896,
7,
82,
2122,
62,
18747,
8,
19841,
1271,
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,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3641,
796,
22626,
1343,
1312,
9,
34350,
1343,
44332,
1003,
17,
11,
474,
9,
9892,
1343,
20268,
1003,
17,
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,
949,
897,
796,
949,
7,
34350,
11,
20268,
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,
220,
220,
220,
220,
220,
220,
220,
3124,
796,
357,
15,
11,
657,
11,
657,
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,
220,
220,
220,
220,
220,
220,
220,
611,
4610,
62,
18747,
58,
17618,
7131,
15,
60,
6624,
705,
52,
10354,
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,
3124,
796,
3124,
62,
11186,
58,
15,
4357,
3124,
62,
11186,
58,
16,
4357,
3124,
62,
11186,
58,
17,
60,
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,
1288,
361,
4610,
62,
18747,
58,
17618,
7131,
15,
60,
6624,
705,
43,
10354,
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,
3124,
796,
3124,
62,
17585,
58,
15,
4357,
3124,
62,
17585,
58,
16,
4357,
3124,
62,
17585,
58,
17,
60,
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,
1288,
361,
4610,
62,
18747,
58,
17618,
7131,
15,
60,
6624,
705,
37,
10354,
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,
3124,
796,
3124,
62,
43745,
58,
15,
4357,
3124,
62,
43745,
58,
16,
4357,
3124,
62,
43745,
58,
17,
60,
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,
1288,
361,
4610,
62,
18747,
58,
17618,
7131,
15,
60,
6624,
705,
49,
10354,
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,
3124,
796,
3124,
62,
14809,
58,
15,
4357,
3124,
62,
14809,
58,
16,
4357,
3124,
62,
14809,
58,
17,
60,
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,
1288,
361,
4610,
62,
18747,
58,
17618,
7131,
15,
60,
6624,
705,
33,
10354,
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,
3124,
796,
3124,
62,
445,
58,
15,
4357,
3124,
62,
445,
58,
16,
4357,
3124,
62,
445,
58,
17,
60,
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,
1288,
361,
4610,
62,
18747,
58,
17618,
7131,
15,
60,
6624,
705,
35,
10354,
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,
3124,
796,
3124,
62,
36022,
58,
15,
4357,
3124,
62,
36022,
58,
16,
4357,
3124,
62,
36022,
58,
17,
60,
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,
1255,
796,
269,
85,
13,
2554,
9248,
7,
20274,
11,
357,
16159,
58,
15,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
17,
828,
3641,
58,
16,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
17,
36911,
357,
16159,
58,
15,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
17,
828,
3641,
58,
16,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
17,
36911,
3124,
11,
532,
16,
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,
220,
220,
220,
220,
220,
220,
220,
611,
18896,
7,
82,
2122,
62,
18747,
58,
17618,
12962,
6624,
352,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
695,
541,
325,
7,
20274,
11,
3641,
11,
357,
600,
7,
1084,
897,
9,
15,
13,
19,
828,
493,
7,
1084,
897,
9,
15,
13,
19,
36911,
657,
11,
532,
3829,
11,
657,
11,
357,
15,
11,
14280,
11,
657,
828,
513,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
1370,
7,
20274,
11,
357,
16159,
58,
15,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
19,
828,
3641,
58,
16,
46570,
357,
16159,
58,
15,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
19,
8,
1343,
493,
7,
1084,
897,
9,
15,
13,
2713,
828,
3641,
58,
16,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
2713,
36911,
357,
15,
11,
14280,
11,
657,
828,
513,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
1370,
7,
20274,
11,
357,
16159,
58,
15,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
19,
828,
3641,
58,
16,
46570,
357,
16159,
58,
15,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
19,
8,
532,
493,
7,
1084,
897,
9,
15,
13,
2713,
828,
3641,
58,
16,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
2713,
36911,
357,
15,
11,
14280,
11,
657,
828,
513,
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,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
4610,
62,
18747,
58,
17618,
7131,
16,
60,
6624,
24018,
1298,
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,
1255,
796,
269,
85,
13,
695,
541,
325,
7,
20274,
11,
3641,
11,
357,
600,
7,
1084,
897,
9,
15,
13,
19,
828,
493,
7,
1084,
897,
9,
15,
13,
19,
36911,
657,
11,
532,
3829,
11,
532,
15259,
11,
357,
15,
11,
14280,
11,
657,
828,
513,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
1370,
7,
20274,
11,
357,
16159,
58,
15,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
19,
828,
3641,
58,
16,
46570,
357,
16159,
58,
15,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
19,
8,
1343,
493,
7,
1084,
897,
9,
15,
13,
2713,
828,
3641,
58,
16,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
2713,
36911,
357,
15,
11,
14280,
11,
657,
828,
513,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
1370,
7,
20274,
11,
357,
16159,
58,
15,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
19,
828,
3641,
58,
16,
46570,
357,
16159,
58,
15,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
19,
8,
532,
493,
7,
1084,
897,
9,
15,
13,
2713,
828,
3641,
58,
16,
60,
532,
493,
7,
1084,
897,
9,
15,
13,
2713,
36911,
357,
15,
11,
14280,
11,
657,
828,
513,
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,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
695,
541,
325,
7,
20274,
11,
3641,
11,
357,
600,
7,
1084,
897,
9,
15,
13,
19,
828,
493,
7,
1084,
897,
9,
15,
13,
19,
36911,
657,
11,
532,
3829,
11,
4101,
11,
357,
15,
11,
14280,
11,
657,
828,
513,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
1370,
7,
20274,
11,
357,
16159,
58,
15,
4357,
3641,
58,
16,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
19,
36911,
357,
16159,
58,
15,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
2713,
828,
3641,
58,
16,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
19,
8,
532,
493,
7,
1084,
897,
9,
15,
13,
2713,
36911,
357,
15,
11,
14280,
11,
657,
828,
513,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
269,
85,
13,
1370,
7,
20274,
11,
357,
16159,
58,
15,
4357,
3641,
58,
16,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
19,
36911,
357,
16159,
58,
15,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
2713,
828,
3641,
58,
16,
60,
1343,
493,
7,
1084,
897,
9,
15,
13,
19,
8,
1343,
493,
7,
1084,
897,
9,
15,
13,
2713,
36911,
357,
15,
11,
14280,
11,
657,
828,
513,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
13,
320,
12860,
7203,
21312,
1134,
338,
23315,
4294,
332,
1600,
1255,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
6407,
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,
3038,
796,
269,
85,
13,
17077,
9218,
3419,
1222,
657,
47596,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3038,
6624,
2760,
10786,
81,
11537,
393,
3038,
6624,
2760,
10786,
49,
6,
2599,
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,
717,
45677,
796,
10352,
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,
717,
5569,
796,
17635,
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,
1218,
5569,
796,
17635,
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,
2270,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
3038,
6624,
2760,
10786,
80,
11537,
393,
3038,
6624,
2760,
10786,
48,
6,
2599,
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,
8420,
7,
15,
8,
628,
220,
220,
220,
611,
16959,
25,
198,
220,
220,
220,
220,
220,
220,
220,
269,
85,
13,
320,
12860,
10786,
66,
7737,
3256,
460,
3281,
8,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
269,
85,
13,
320,
12860,
7203,
21312,
1134,
338,
23315,
4294,
332,
1600,
8246,
8,
220,
220,
220,
220,
628,
220,
220,
220,
1994,
796,
269,
85,
13,
17077,
9218,
7,
1238,
8,
198,
220,
220,
220,
611,
1994,
6624,
2760,
10786,
80,
11537,
393,
1994,
6624,
2760,
10786,
48,
6,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
2270,
198
] | 1.767335 | 13,556 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__metaclss__=type
import random
import math
import collections
from PIL import Image, ImageDraw, ImageFont
from utils.font import FontObj
from utils.color import Color
import skimage.util
import numpy as np
import cv2
import matplotlib.pyplot as plt
import sys
import time
if __name__ == '__main__':
pass | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
4164,
37779,
824,
834,
28,
4906,
198,
198,
11748,
4738,
198,
11748,
10688,
198,
11748,
17268,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
11,
7412,
23252,
198,
6738,
3384,
4487,
13,
10331,
1330,
24060,
49201,
198,
6738,
3384,
4487,
13,
8043,
1330,
5315,
198,
11748,
1341,
9060,
13,
22602,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
25064,
198,
11748,
640,
628,
197,
197,
628,
628,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
6603
] | 2.897638 | 127 |
from dimacs import load_file
| [
6738,
5391,
16436,
1330,
3440,
62,
7753,
198
] | 3.625 | 8 |
# Code behind module for DCAL_Custom_Mosaics.ipynb
################################
##
## Import Statments
##
################################
# Import standard Python modules
import sys
import datacube
# Import DCAL utilities containing function definitions used generally across DCAL
sys.path.append('../DCAL_utils')
################################
##
## Function Definitions
##
################################
# None.
| [
2,
6127,
2157,
8265,
329,
6257,
1847,
62,
15022,
62,
44,
8546,
873,
13,
541,
2047,
65,
198,
198,
29113,
198,
2235,
198,
2235,
17267,
5133,
902,
198,
2235,
198,
29113,
198,
198,
2,
17267,
3210,
11361,
13103,
198,
11748,
25064,
198,
11748,
4818,
330,
3266,
198,
198,
2,
17267,
6257,
1847,
20081,
7268,
2163,
17336,
973,
4143,
1973,
6257,
1847,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
9697,
1847,
62,
26791,
11537,
628,
198,
29113,
198,
2235,
198,
2235,
15553,
45205,
198,
2235,
198,
29113,
198,
198,
2,
6045,
13,
628
] | 4.623656 | 93 |
import fulfillment
fulfillment.core.api_key = 'YOUR_API_KEY_GOES_HERE'
# set debug to true to get print json
fulfillment.core.Debug = True
fulfillment.Warehouse.retrieveALL()
| [
11748,
32402,
198,
198,
913,
20797,
434,
13,
7295,
13,
15042,
62,
2539,
796,
705,
56,
11698,
62,
17614,
62,
20373,
62,
11230,
1546,
62,
39,
9338,
6,
198,
2,
900,
14257,
284,
2081,
284,
651,
3601,
33918,
198,
913,
20797,
434,
13,
7295,
13,
27509,
796,
6407,
198,
198,
913,
20797,
434,
13,
38824,
4803,
13,
1186,
30227,
7036,
3419,
198
] | 2.854839 | 62 |
r"""
Solve Poisson equation in 2D with periodic bcs in one direction
and homogeneous Neumann in the other
\nabla^2 u = f,
Use Fourier basis for the periodic direction and Shen's Neumann basis for the
non-periodic direction.
The equation to solve is
(\nabla^2 u, v) = (f, v)
"""
import sys
import os
from sympy import symbols, cos, sin, pi
import numpy as np
from shenfun import inner, div, grad, TestFunction, TrialFunction, \
TensorProductSpace, FunctionSpace, Array, Function, comm, la, dx, \
chebyshev
# Collect basis and solver from either Chebyshev or Legendre submodules
assert len(sys.argv) == 3, "Call with two command-line arguments"
assert sys.argv[-1].lower() in ('legendre', 'chebyshev')
assert isinstance(int(sys.argv[-2]), int)
family = sys.argv[-1].lower()
Solver = chebyshev.la.Helmholtz if family == 'chebyshev' else la.SolverGeneric1ND
# Use sympy to compute a rhs, given an analytical solution
x, y = symbols("x,y", real=True)
#ue = (1-x**3)*cos(2*y)
ue = cos(2*pi*x)
fe = -ue.diff(x, 2)-ue.diff(y, 2)
# Size of discretization
N = int(sys.argv[-2])
N = (N, N)
bc = {'left': ('N', ue.diff(x, 1).subs(x, -1)), 'right': ('N', ue.diff(x, 1).subs(x, 1))}
SN = FunctionSpace(N[0], family=family, bc=bc)
K1 = FunctionSpace(N[1], family='F', dtype='d')
T = TensorProductSpace(comm, (SN, K1), axes=(0, 1))
u = TrialFunction(T)
v = TestFunction(T)
# Get f on quad points
fj = Array(T, buffer=fe)
# Compute right hand side of Poisson equation
f_hat = inner(v, fj)
# Get left hand side of Poisson equation
matrices = inner(v, -div(grad(u)))
# Create Helmholtz linear algebra solver
sol = Solver(matrices)
constraint = ((0, dx(Array(T, buffer=ue), weighted=True)/dx(Array(T, val=1), weighted=True)),)
# Solve and transform to real space
u_hat = Function(T).set_boundary_dofs() # Solution spectral space
u_hat = sol(f_hat, u_hat, constraints=constraint)
uq = T.backward(u_hat).copy()
# Compare with analytical solution
uj = Array(T, buffer=ue)
print(abs(uj-uq).max())
assert np.allclose(uj, uq)
if 'pytest' not in os.environ:
import matplotlib.pyplot as plt
plt.figure()
X = T.local_mesh(True) # With broadcasting=True the shape of X is local_shape, even though the number of datapoints are still the same as in 1D
plt.contourf(X[0], X[1], uq)
plt.colorbar()
plt.figure()
plt.contourf(X[0], X[1], uj)
plt.colorbar()
plt.figure()
plt.contourf(X[0], X[1], uq-uj)
plt.colorbar()
plt.title('Error')
plt.show()
| [
81,
37811,
198,
50,
6442,
7695,
30927,
16022,
287,
362,
35,
351,
27458,
275,
6359,
287,
530,
4571,
198,
392,
3488,
32269,
3169,
40062,
287,
262,
584,
628,
220,
220,
220,
3467,
77,
397,
5031,
61,
17,
334,
796,
277,
11,
198,
198,
11041,
34296,
5277,
4308,
329,
262,
27458,
4571,
290,
22323,
338,
3169,
40062,
4308,
329,
262,
198,
13159,
12,
41007,
291,
4571,
13,
198,
198,
464,
16022,
284,
8494,
318,
628,
220,
220,
220,
220,
357,
59,
77,
397,
5031,
61,
17,
334,
11,
410,
8,
796,
357,
69,
11,
410,
8,
198,
198,
37811,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
10558,
88,
1330,
14354,
11,
8615,
11,
7813,
11,
31028,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
673,
77,
12543,
1330,
8434,
11,
2659,
11,
3915,
11,
6208,
22203,
11,
21960,
22203,
11,
3467,
198,
220,
220,
220,
309,
22854,
15667,
14106,
11,
15553,
14106,
11,
15690,
11,
15553,
11,
725,
11,
8591,
11,
44332,
11,
3467,
198,
220,
220,
220,
1125,
48209,
258,
85,
198,
198,
2,
9745,
4308,
290,
1540,
332,
422,
2035,
2580,
48209,
258,
85,
393,
9883,
260,
850,
18170,
198,
30493,
18896,
7,
17597,
13,
853,
85,
8,
6624,
513,
11,
366,
14134,
351,
734,
3141,
12,
1370,
7159,
1,
198,
30493,
25064,
13,
853,
85,
58,
12,
16,
4083,
21037,
3419,
287,
19203,
1455,
437,
260,
3256,
705,
2395,
48209,
258,
85,
11537,
198,
30493,
318,
39098,
7,
600,
7,
17597,
13,
853,
85,
58,
12,
17,
46570,
493,
8,
198,
198,
17989,
796,
25064,
13,
853,
85,
58,
12,
16,
4083,
21037,
3419,
198,
50,
14375,
796,
1125,
48209,
258,
85,
13,
5031,
13,
12621,
76,
3937,
22877,
611,
1641,
6624,
705,
2395,
48209,
258,
85,
6,
2073,
8591,
13,
50,
14375,
46189,
16,
8575,
198,
198,
2,
5765,
10558,
88,
284,
24061,
257,
9529,
82,
11,
1813,
281,
30063,
4610,
198,
87,
11,
331,
796,
14354,
7203,
87,
11,
88,
1600,
1103,
28,
17821,
8,
198,
2,
518,
796,
357,
16,
12,
87,
1174,
18,
27493,
6966,
7,
17,
9,
88,
8,
198,
518,
796,
8615,
7,
17,
9,
14415,
9,
87,
8,
198,
5036,
796,
532,
518,
13,
26069,
7,
87,
11,
362,
13219,
518,
13,
26069,
7,
88,
11,
362,
8,
198,
198,
2,
12849,
286,
1221,
1186,
1634,
198,
45,
796,
493,
7,
17597,
13,
853,
85,
58,
12,
17,
12962,
198,
45,
796,
357,
45,
11,
399,
8,
198,
15630,
796,
1391,
6,
9464,
10354,
19203,
45,
3256,
334,
68,
13,
26069,
7,
87,
11,
352,
737,
7266,
82,
7,
87,
11,
532,
16,
36911,
705,
3506,
10354,
19203,
45,
3256,
334,
68,
13,
26069,
7,
87,
11,
352,
737,
7266,
82,
7,
87,
11,
352,
4008,
92,
198,
15571,
796,
15553,
14106,
7,
45,
58,
15,
4357,
1641,
28,
17989,
11,
47125,
28,
15630,
8,
198,
42,
16,
796,
15553,
14106,
7,
45,
58,
16,
4357,
1641,
11639,
37,
3256,
288,
4906,
11639,
67,
11537,
198,
51,
796,
309,
22854,
15667,
14106,
7,
9503,
11,
357,
15571,
11,
509,
16,
828,
34197,
16193,
15,
11,
352,
4008,
198,
84,
796,
21960,
22203,
7,
51,
8,
198,
85,
796,
6208,
22203,
7,
51,
8,
198,
198,
2,
3497,
277,
319,
15094,
2173,
198,
69,
73,
796,
15690,
7,
51,
11,
11876,
28,
5036,
8,
198,
198,
2,
3082,
1133,
826,
1021,
1735,
286,
7695,
30927,
16022,
198,
69,
62,
5183,
796,
8434,
7,
85,
11,
277,
73,
8,
198,
198,
2,
3497,
1364,
1021,
1735,
286,
7695,
30927,
16022,
198,
6759,
45977,
796,
8434,
7,
85,
11,
532,
7146,
7,
9744,
7,
84,
22305,
198,
198,
2,
13610,
28351,
3937,
22877,
14174,
37139,
1540,
332,
198,
34453,
796,
4294,
332,
7,
6759,
45977,
8,
198,
198,
1102,
2536,
2913,
796,
14808,
15,
11,
44332,
7,
19182,
7,
51,
11,
11876,
28,
518,
828,
26356,
28,
17821,
20679,
34350,
7,
19182,
7,
51,
11,
1188,
28,
16,
828,
26356,
28,
17821,
36911,
8,
198,
198,
2,
4294,
303,
290,
6121,
284,
1103,
2272,
198,
84,
62,
5183,
796,
15553,
7,
51,
737,
2617,
62,
7784,
560,
62,
67,
1659,
82,
3419,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
28186,
37410,
2272,
198,
84,
62,
5183,
796,
1540,
7,
69,
62,
5183,
11,
334,
62,
5183,
11,
17778,
28,
1102,
2536,
2913,
8,
198,
198,
84,
80,
796,
309,
13,
1891,
904,
7,
84,
62,
5183,
737,
30073,
3419,
198,
198,
2,
27814,
351,
30063,
4610,
198,
23577,
796,
15690,
7,
51,
11,
11876,
28,
518,
8,
198,
4798,
7,
8937,
7,
23577,
12,
84,
80,
737,
9806,
28955,
198,
30493,
45941,
13,
439,
19836,
7,
23577,
11,
334,
80,
8,
198,
198,
361,
705,
9078,
9288,
6,
407,
287,
28686,
13,
268,
2268,
25,
198,
220,
220,
220,
1330,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
220,
220,
220,
458,
83,
13,
26875,
3419,
198,
220,
220,
220,
1395,
796,
309,
13,
12001,
62,
76,
5069,
7,
17821,
8,
1303,
2080,
22978,
28,
17821,
262,
5485,
286,
1395,
318,
1957,
62,
43358,
11,
772,
996,
262,
1271,
286,
4818,
499,
1563,
82,
389,
991,
262,
976,
355,
287,
352,
35,
198,
220,
220,
220,
458,
83,
13,
3642,
454,
69,
7,
55,
58,
15,
4357,
1395,
58,
16,
4357,
334,
80,
8,
198,
220,
220,
220,
458,
83,
13,
8043,
5657,
3419,
628,
220,
220,
220,
458,
83,
13,
26875,
3419,
198,
220,
220,
220,
458,
83,
13,
3642,
454,
69,
7,
55,
58,
15,
4357,
1395,
58,
16,
4357,
334,
73,
8,
198,
220,
220,
220,
458,
83,
13,
8043,
5657,
3419,
628,
220,
220,
220,
458,
83,
13,
26875,
3419,
198,
220,
220,
220,
458,
83,
13,
3642,
454,
69,
7,
55,
58,
15,
4357,
1395,
58,
16,
4357,
334,
80,
12,
23577,
8,
198,
220,
220,
220,
458,
83,
13,
8043,
5657,
3419,
198,
220,
220,
220,
458,
83,
13,
7839,
10786,
12331,
11537,
628,
220,
220,
220,
458,
83,
13,
12860,
3419,
198
] | 2.505988 | 1,002 |
import subprocess
import itertools
command="xrandr --listmonitors"
output = subprocess.run(command.split(), stdout=subprocess.PIPE, check=True, text=True)
output = output.stdout
displays_lines = output.split('\n')[1:-1]
displays = []
for line in displays_lines:
displays.append(line.split()[-1])
options = []
for L in range(1, len(displays)):
for subset in itertools.combinations(displays, L):
options.append(subset)
for item in itertools.permutations(displays):
options.append(item)
#print(options)
for option in options:
if len(option) == 1:
print(option[0] + " ONLY")
else:
to_print = option[0]
for i in range(1, len(option)):
to_print = to_print + " + " + option[i]
print(to_print)
print("All the same")
| [
11748,
850,
14681,
198,
11748,
340,
861,
10141,
198,
198,
21812,
2625,
87,
25192,
81,
1377,
4868,
2144,
6742,
1,
198,
198,
22915,
796,
850,
14681,
13,
5143,
7,
21812,
13,
35312,
22784,
14367,
448,
28,
7266,
14681,
13,
47,
4061,
36,
11,
2198,
28,
17821,
11,
2420,
28,
17821,
8,
198,
22915,
796,
5072,
13,
19282,
448,
198,
198,
6381,
26024,
62,
6615,
796,
5072,
13,
35312,
10786,
59,
77,
11537,
58,
16,
21912,
16,
60,
198,
198,
6381,
26024,
796,
17635,
198,
1640,
1627,
287,
11298,
62,
6615,
25,
198,
220,
220,
220,
11298,
13,
33295,
7,
1370,
13,
35312,
3419,
58,
12,
16,
12962,
198,
198,
25811,
796,
17635,
198,
1640,
406,
287,
2837,
7,
16,
11,
18896,
7,
6381,
26024,
8,
2599,
198,
220,
220,
220,
329,
24637,
287,
340,
861,
10141,
13,
24011,
7352,
7,
6381,
26024,
11,
406,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3689,
13,
33295,
7,
7266,
2617,
8,
198,
198,
1640,
2378,
287,
340,
861,
10141,
13,
16321,
32855,
7,
6381,
26024,
2599,
198,
220,
220,
220,
3689,
13,
33295,
7,
9186,
8,
198,
198,
2,
4798,
7,
25811,
8,
198,
198,
1640,
3038,
287,
3689,
25,
198,
220,
220,
220,
611,
18896,
7,
18076,
8,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
18076,
58,
15,
60,
1343,
366,
22224,
4943,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
284,
62,
4798,
796,
3038,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
16,
11,
18896,
7,
18076,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
284,
62,
4798,
796,
284,
62,
4798,
1343,
366,
1343,
366,
1343,
3038,
58,
72,
60,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
1462,
62,
4798,
8,
198,
4798,
7203,
3237,
262,
976,
4943,
198
] | 2.454829 | 321 |
from random import randint
import threading
# Variavel global
n_populacao = []
# funcoes
if __name__ == '__main__':
# Leitura do arquivo externo (instancias)
file = open("100.txt")
arquivo = file.read() # ler a cadeia de caracteres do arquivo .txt
instancias = arquivo.split() # separar e agrupar os caracteres
# manipulando a entrada dos dados
qtd_instancias = (len(instancias))
valor = []
peso = []
# salvar as infos do valor na lista valor
for i in range(2, qtd_instancias, 2):
valor.append(int(instancias[i]))
# salvar as infors do peso na lista peso
for i in range(3,qtd_instancias,2):
peso.append(int(instancias[i]))
# Variaveis
tam_pop = 2000 # pode ser alterada pelo usuário
max_geracao = 10
processos = 2
tx_mutacao = 5 # pode ser alterada pelo usuario (qtd de itens a sofrer mutação)
cap_max = int(instancias[1])
qtd_itens = int(instancias[0])
geracao_atual = 1
populacao = []
# Inicio do algoritmo
# 1 - Gerar a população inicial
populacao = gerar_pop(tam_pop, peso, valor, cap_max, qtd_itens)
# 2 - Avaliar a população
while (geracao_atual != max_geracao+1):
print("Geracao: ", geracao_atual)
#definir 6 processos
if (processos == 1):
itens = tam_pop/processos
i0=i1=0
x1=0
i1=int(i0+itens)
while(i1<=(tam_pop-1)):
i1=i1+1
# Processo 1
t1 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i0,i1))
t1.start()
t1.join()
if (t1.is_alive()==False):
del populacao
populacao = n_populacao
elif (processos == 2):
itens = tam_pop/processos
i0=i1=i2=0
i1=int(i0+itens)
i2=int(i1+itens)
while(i2<=(tam_pop-1)):
i2=i2+1
# Processo 1
t1 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i0,i1))
t1.start()
t1.join()
# Processo 2
t2 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i1,i2))
t2.start()
t2.join()
if (t1.is_alive()==t2.is_alive()==False):
del populacao
populacao = n_populacao
elif (processos==3):
itens = tam_pop/processos
i0=i1=i2=i3=0
i1=int(i0+itens)
i2=int(i1+itens)
i3=int(i2+itens)
while(i3<=(tam_pop-1)):
i3=i3+1
# Processo 1
t1 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i0,i1))
t1.start()
t1.join()
# Processo 2
t2 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i1,i2))
t2.start()
# Processo 3
t3 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i2,i3))
t3.start()
t2.join()
t3.join()
if (t1.is_alive()==t2.is_alive()==t3.is_alive()==False):
del populacao
populacao = n_populacao
elif (processos==4):
itens = tam_pop/processos
i0=i1=i2=i3=i4=0
i1=int(i0+itens)
i2=int(i1+itens)
i3=int(i2+itens)
i4=int(i3+itens)
while(i4<=(tam_pop-1)):
i4=i4+1
# Processo 1
t1 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i0,i1))
t1.start()
t1.join()
# Processo 2
t2 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i1,i2))
t2.start()
# Processo 3
t3 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i2,i3))
t3.start()
# Processo 4
t4 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i3,i4))
t4.start()
t2.join()
t3.join()
t4.join()
if (t1.is_alive()==t2.is_alive()==t3.is_alive()==t4.is_alive()==False):
del populacao
populacao = n_populacao
elif (processos==5):
itens = tam_pop/processos
i0=i1=i2=i3=i4=i5=0
i1=int(i0+itens)
i2=int(i1+itens)
i3=int(i2+itens)
i4=int(i3+itens)
i5=int(i4+itens)
while(i5<=(tam_pop-1)):
i5=i5+1
# Processo 1
t1 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i0,i1))
t1.start()
t1.join()
# Processo 2
t2 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i1,i2))
t2.start()
# Processo 3
t3 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i2,i3))
t3.start()
# Processo 4
t4 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i3,i4))
t4.start()
# Processo 5
t5 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i4,i5))
t5.start()
t2.join()
t3.join()
t4.join()
t5.join()
if (t1.is_alive()==t2.is_alive()==t3.is_alive()==t4.is_alive()==t5.is_alive()==False):
del populacao
populacao = n_populacao
elif (processos==6):
itens = tam_pop/processos
i0=i1=i2=i3=i4=i5=i6=0
i1=int(i0+itens)
i2=int(i1+itens)
i3=int(i2+itens)
i4=int(i3+itens)
i5=int(i4+itens)
i6=int(i5+itens)
while(i6<=(tam_pop-1)):
i6=i6+1
# Processo 1
t1 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i0,i1))
t1.start()
t1.join()
# Processo 2
t2 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i1,i2))
t2.start()
# Processo 3
t3 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i2,i3))
t3.start()
# Processo 4
t4 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i3,i4))
t4.start()
# Processo 5
t5 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i4,i5))
t5.start()
# Processo 6
t6 = threading.Thread(target=crossover, args=(populacao, tx_mutacao, peso, valor, cap_max, i5,i6))
t6.start()
t2.join()
t3.join()
t4.join()
t5.join()
t6.join()
if (t1.is_alive()==t2.is_alive()==t3.is_alive()==t4.is_alive()==t5.is_alive()==t6.is_alive()==False):
del populacao
populacao = n_populacao
geracao_atual += 1
if geracao_atual == max_geracao:
populacao.sort(reverse=True)
print("Processos:", processos)
print("Melhor solucao da geracao ", geracao_atual-1)
print("Valor: ",populacao[0][0]," Peso: ",populacao[0][1])
print("Cromossomo", populacao[0][2:])
"""
import threading
from multiprocessing import Queue
def dobro(x, que):
x = x*x
que.put(x)
print(x)
queue1 = Queue()
t1 = threading.Thread(target=dobro, args=(2,queue1))
t1.start()
print(t1)
#t1.join()
x = queue1.get()
print(x)
print(t1)
""" | [
6738,
4738,
1330,
43720,
600,
198,
11748,
4704,
278,
198,
2,
569,
10312,
626,
3298,
198,
77,
62,
12924,
377,
330,
5488,
796,
17635,
198,
2,
1257,
1073,
274,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
2,
1004,
270,
5330,
466,
610,
421,
23593,
409,
759,
78,
357,
8625,
272,
979,
292,
8,
220,
198,
197,
7753,
796,
1280,
7203,
3064,
13,
14116,
4943,
198,
197,
283,
421,
23593,
796,
2393,
13,
961,
3419,
1303,
300,
263,
257,
269,
671,
544,
390,
1097,
529,
68,
411,
466,
610,
421,
23593,
764,
14116,
198,
197,
8625,
272,
979,
292,
796,
610,
421,
23593,
13,
35312,
3419,
1303,
2880,
283,
304,
556,
622,
1845,
28686,
1097,
529,
68,
411,
198,
197,
2,
7704,
377,
25440,
257,
24481,
4763,
23430,
9955,
418,
198,
197,
80,
8671,
62,
8625,
272,
979,
292,
796,
357,
11925,
7,
8625,
272,
979,
292,
4008,
198,
197,
2100,
273,
796,
17635,
198,
197,
12272,
78,
796,
17635,
198,
197,
2,
3664,
7785,
355,
1167,
418,
466,
1188,
273,
12385,
1351,
64,
1188,
273,
220,
198,
197,
1640,
1312,
287,
2837,
7,
17,
11,
10662,
8671,
62,
8625,
272,
979,
292,
11,
362,
2599,
198,
197,
220,
220,
220,
1188,
273,
13,
33295,
7,
600,
7,
8625,
272,
979,
292,
58,
72,
60,
4008,
198,
197,
2,
3664,
7785,
355,
1167,
669,
466,
32317,
78,
12385,
1351,
64,
32317,
78,
198,
197,
1640,
1312,
287,
2837,
7,
18,
11,
80,
8671,
62,
8625,
272,
979,
292,
11,
17,
2599,
198,
197,
220,
220,
220,
32317,
78,
13,
33295,
7,
600,
7,
8625,
272,
979,
292,
58,
72,
60,
4008,
198,
197,
2,
569,
10312,
303,
271,
198,
197,
83,
321,
62,
12924,
796,
4751,
1303,
279,
1098,
1055,
8343,
4763,
16176,
78,
514,
84,
6557,
27250,
198,
197,
9806,
62,
1362,
330,
5488,
796,
838,
198,
197,
14681,
418,
796,
362,
198,
197,
17602,
62,
21973,
330,
5488,
796,
642,
220,
1303,
279,
1098,
1055,
8343,
4763,
16176,
78,
514,
84,
4982,
357,
80,
8671,
390,
340,
641,
257,
523,
69,
11751,
4517,
64,
16175,
28749,
8,
198,
197,
11128,
62,
9806,
796,
493,
7,
8625,
272,
979,
292,
58,
16,
12962,
198,
197,
80,
8671,
62,
270,
641,
796,
493,
7,
8625,
272,
979,
292,
58,
15,
12962,
198,
197,
1362,
330,
5488,
62,
265,
723,
796,
352,
198,
197,
12924,
377,
330,
5488,
796,
17635,
628,
197,
2,
554,
46441,
466,
435,
7053,
270,
5908,
198,
197,
2,
352,
532,
13573,
283,
257,
1461,
4712,
16175,
28749,
287,
6652,
198,
197,
12924,
377,
330,
5488,
796,
27602,
283,
62,
12924,
7,
83,
321,
62,
12924,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
10662,
8671,
62,
270,
641,
8,
198,
197,
2,
362,
532,
23587,
12571,
257,
1461,
4712,
16175,
28749,
198,
197,
4514,
357,
1362,
330,
5488,
62,
265,
723,
14512,
3509,
62,
1362,
330,
5488,
10,
16,
2599,
198,
197,
197,
4798,
7203,
38069,
330,
5488,
25,
33172,
27602,
330,
5488,
62,
265,
723,
8,
198,
197,
197,
2,
4299,
259,
343,
718,
1429,
418,
198,
197,
197,
361,
357,
14681,
418,
6624,
352,
2599,
198,
197,
197,
197,
197,
270,
641,
796,
21885,
62,
12924,
14,
14681,
418,
198,
197,
197,
197,
197,
72,
15,
28,
72,
16,
28,
15,
198,
197,
197,
197,
197,
87,
16,
28,
15,
198,
197,
197,
197,
197,
72,
16,
28,
600,
7,
72,
15,
10,
270,
641,
8,
198,
197,
197,
197,
197,
4514,
7,
72,
16,
27,
16193,
83,
321,
62,
12924,
12,
16,
8,
2599,
198,
197,
197,
197,
197,
197,
72,
16,
28,
72,
16,
10,
16,
198,
197,
197,
197,
197,
2,
10854,
78,
352,
198,
197,
197,
197,
197,
83,
16,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
15,
11,
72,
16,
4008,
198,
197,
197,
197,
197,
83,
16,
13,
9688,
3419,
198,
197,
197,
197,
197,
83,
16,
13,
22179,
3419,
198,
197,
197,
197,
197,
361,
357,
83,
16,
13,
271,
62,
282,
425,
3419,
855,
25101,
2599,
198,
197,
197,
197,
197,
197,
12381,
16595,
330,
5488,
198,
197,
197,
197,
197,
197,
12924,
377,
330,
5488,
796,
299,
62,
12924,
377,
330,
5488,
198,
197,
197,
417,
361,
357,
14681,
418,
6624,
362,
2599,
198,
197,
197,
197,
197,
270,
641,
796,
21885,
62,
12924,
14,
14681,
418,
198,
197,
197,
197,
197,
72,
15,
28,
72,
16,
28,
72,
17,
28,
15,
198,
197,
197,
197,
197,
72,
16,
28,
600,
7,
72,
15,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
17,
28,
600,
7,
72,
16,
10,
270,
641,
8,
198,
197,
197,
197,
197,
4514,
7,
72,
17,
27,
16193,
83,
321,
62,
12924,
12,
16,
8,
2599,
198,
197,
197,
197,
197,
197,
72,
17,
28,
72,
17,
10,
16,
198,
197,
197,
197,
197,
2,
10854,
78,
352,
198,
197,
197,
197,
197,
83,
16,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
15,
11,
72,
16,
4008,
198,
197,
197,
197,
197,
83,
16,
13,
9688,
3419,
198,
197,
197,
197,
197,
83,
16,
13,
22179,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
362,
198,
197,
197,
197,
197,
83,
17,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
16,
11,
72,
17,
4008,
198,
197,
197,
197,
197,
83,
17,
13,
9688,
3419,
198,
197,
197,
197,
197,
83,
17,
13,
22179,
3419,
198,
197,
197,
197,
197,
361,
357,
83,
16,
13,
271,
62,
282,
425,
3419,
855,
83,
17,
13,
271,
62,
282,
425,
3419,
855,
25101,
2599,
198,
197,
197,
197,
197,
197,
12381,
16595,
330,
5488,
198,
197,
197,
197,
197,
197,
12924,
377,
330,
5488,
796,
299,
62,
12924,
377,
330,
5488,
628,
197,
197,
417,
361,
357,
14681,
418,
855,
18,
2599,
198,
197,
197,
197,
197,
270,
641,
796,
21885,
62,
12924,
14,
14681,
418,
198,
197,
197,
197,
197,
72,
15,
28,
72,
16,
28,
72,
17,
28,
72,
18,
28,
15,
198,
197,
197,
197,
197,
72,
16,
28,
600,
7,
72,
15,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
17,
28,
600,
7,
72,
16,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
18,
28,
600,
7,
72,
17,
10,
270,
641,
8,
198,
197,
197,
197,
197,
4514,
7,
72,
18,
27,
16193,
83,
321,
62,
12924,
12,
16,
8,
2599,
198,
197,
197,
197,
197,
197,
72,
18,
28,
72,
18,
10,
16,
198,
197,
197,
197,
197,
2,
10854,
78,
352,
198,
197,
197,
197,
197,
83,
16,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
15,
11,
72,
16,
4008,
198,
197,
197,
197,
197,
83,
16,
13,
9688,
3419,
198,
197,
197,
197,
197,
83,
16,
13,
22179,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
362,
198,
197,
197,
197,
197,
83,
17,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
16,
11,
72,
17,
4008,
198,
197,
197,
197,
197,
83,
17,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
513,
198,
197,
197,
197,
197,
83,
18,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
17,
11,
72,
18,
4008,
198,
197,
197,
197,
197,
83,
18,
13,
9688,
3419,
198,
197,
197,
197,
197,
83,
17,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
18,
13,
22179,
3419,
198,
197,
197,
197,
197,
361,
357,
83,
16,
13,
271,
62,
282,
425,
3419,
855,
83,
17,
13,
271,
62,
282,
425,
3419,
855,
83,
18,
13,
271,
62,
282,
425,
3419,
855,
25101,
2599,
198,
197,
197,
197,
197,
197,
12381,
16595,
330,
5488,
198,
197,
197,
197,
197,
197,
12924,
377,
330,
5488,
796,
299,
62,
12924,
377,
330,
5488,
198,
197,
197,
417,
361,
357,
14681,
418,
855,
19,
2599,
198,
197,
197,
197,
197,
270,
641,
796,
21885,
62,
12924,
14,
14681,
418,
198,
197,
197,
197,
197,
72,
15,
28,
72,
16,
28,
72,
17,
28,
72,
18,
28,
72,
19,
28,
15,
198,
197,
197,
197,
197,
72,
16,
28,
600,
7,
72,
15,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
17,
28,
600,
7,
72,
16,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
18,
28,
600,
7,
72,
17,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
19,
28,
600,
7,
72,
18,
10,
270,
641,
8,
198,
197,
197,
197,
197,
4514,
7,
72,
19,
27,
16193,
83,
321,
62,
12924,
12,
16,
8,
2599,
198,
197,
197,
197,
197,
197,
72,
19,
28,
72,
19,
10,
16,
198,
197,
197,
197,
197,
2,
10854,
78,
352,
198,
197,
197,
197,
197,
83,
16,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
15,
11,
72,
16,
4008,
198,
197,
197,
197,
197,
83,
16,
13,
9688,
3419,
198,
197,
197,
197,
197,
83,
16,
13,
22179,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
362,
198,
197,
197,
197,
197,
83,
17,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
16,
11,
72,
17,
4008,
198,
197,
197,
197,
197,
83,
17,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
513,
198,
197,
197,
197,
197,
83,
18,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
17,
11,
72,
18,
4008,
198,
197,
197,
197,
197,
83,
18,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
604,
198,
197,
197,
197,
197,
83,
19,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
18,
11,
72,
19,
4008,
198,
197,
197,
197,
197,
83,
19,
13,
9688,
3419,
198,
197,
197,
197,
197,
83,
17,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
18,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
19,
13,
22179,
3419,
198,
197,
197,
197,
197,
361,
357,
83,
16,
13,
271,
62,
282,
425,
3419,
855,
83,
17,
13,
271,
62,
282,
425,
3419,
855,
83,
18,
13,
271,
62,
282,
425,
3419,
855,
83,
19,
13,
271,
62,
282,
425,
3419,
855,
25101,
2599,
198,
197,
197,
197,
197,
197,
12381,
16595,
330,
5488,
198,
197,
197,
197,
197,
197,
12924,
377,
330,
5488,
796,
299,
62,
12924,
377,
330,
5488,
628,
197,
197,
417,
361,
357,
14681,
418,
855,
20,
2599,
198,
197,
197,
197,
197,
270,
641,
796,
21885,
62,
12924,
14,
14681,
418,
198,
197,
197,
197,
197,
72,
15,
28,
72,
16,
28,
72,
17,
28,
72,
18,
28,
72,
19,
28,
72,
20,
28,
15,
198,
197,
197,
197,
197,
72,
16,
28,
600,
7,
72,
15,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
17,
28,
600,
7,
72,
16,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
18,
28,
600,
7,
72,
17,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
19,
28,
600,
7,
72,
18,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
20,
28,
600,
7,
72,
19,
10,
270,
641,
8,
198,
197,
197,
197,
197,
4514,
7,
72,
20,
27,
16193,
83,
321,
62,
12924,
12,
16,
8,
2599,
198,
197,
197,
197,
197,
197,
72,
20,
28,
72,
20,
10,
16,
198,
197,
197,
197,
197,
2,
10854,
78,
352,
198,
197,
197,
197,
197,
83,
16,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
15,
11,
72,
16,
4008,
198,
197,
197,
197,
197,
83,
16,
13,
9688,
3419,
198,
197,
197,
197,
197,
83,
16,
13,
22179,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
362,
198,
197,
197,
197,
197,
83,
17,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
16,
11,
72,
17,
4008,
198,
197,
197,
197,
197,
83,
17,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
513,
198,
197,
197,
197,
197,
83,
18,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
17,
11,
72,
18,
4008,
198,
197,
197,
197,
197,
83,
18,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
604,
198,
197,
197,
197,
197,
83,
19,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
18,
11,
72,
19,
4008,
198,
197,
197,
197,
197,
83,
19,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
642,
198,
197,
197,
197,
197,
83,
20,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
19,
11,
72,
20,
4008,
198,
197,
197,
197,
197,
83,
20,
13,
9688,
3419,
628,
197,
197,
197,
197,
83,
17,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
18,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
19,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
20,
13,
22179,
3419,
198,
197,
197,
197,
197,
361,
357,
83,
16,
13,
271,
62,
282,
425,
3419,
855,
83,
17,
13,
271,
62,
282,
425,
3419,
855,
83,
18,
13,
271,
62,
282,
425,
3419,
855,
83,
19,
13,
271,
62,
282,
425,
3419,
855,
83,
20,
13,
271,
62,
282,
425,
3419,
855,
25101,
2599,
198,
197,
197,
197,
197,
197,
12381,
16595,
330,
5488,
198,
197,
197,
197,
197,
197,
12924,
377,
330,
5488,
796,
299,
62,
12924,
377,
330,
5488,
198,
197,
197,
417,
361,
357,
14681,
418,
855,
21,
2599,
198,
197,
197,
197,
197,
270,
641,
796,
21885,
62,
12924,
14,
14681,
418,
198,
197,
197,
197,
197,
72,
15,
28,
72,
16,
28,
72,
17,
28,
72,
18,
28,
72,
19,
28,
72,
20,
28,
72,
21,
28,
15,
198,
197,
197,
197,
197,
72,
16,
28,
600,
7,
72,
15,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
17,
28,
600,
7,
72,
16,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
18,
28,
600,
7,
72,
17,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
19,
28,
600,
7,
72,
18,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
20,
28,
600,
7,
72,
19,
10,
270,
641,
8,
198,
197,
197,
197,
197,
72,
21,
28,
600,
7,
72,
20,
10,
270,
641,
8,
198,
197,
197,
197,
197,
4514,
7,
72,
21,
27,
16193,
83,
321,
62,
12924,
12,
16,
8,
2599,
198,
197,
197,
197,
197,
197,
72,
21,
28,
72,
21,
10,
16,
198,
197,
197,
197,
197,
2,
10854,
78,
352,
198,
197,
197,
197,
197,
83,
16,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
15,
11,
72,
16,
4008,
198,
197,
197,
197,
197,
83,
16,
13,
9688,
3419,
198,
197,
197,
197,
197,
83,
16,
13,
22179,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
362,
198,
197,
197,
197,
197,
83,
17,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
16,
11,
72,
17,
4008,
198,
197,
197,
197,
197,
83,
17,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
513,
198,
197,
197,
197,
197,
83,
18,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
17,
11,
72,
18,
4008,
198,
197,
197,
197,
197,
83,
18,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
604,
198,
197,
197,
197,
197,
83,
19,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
18,
11,
72,
19,
4008,
198,
197,
197,
197,
197,
83,
19,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
642,
198,
197,
197,
197,
197,
83,
20,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
19,
11,
72,
20,
4008,
198,
197,
197,
197,
197,
83,
20,
13,
9688,
3419,
198,
197,
197,
197,
197,
2,
10854,
78,
718,
198,
197,
197,
197,
197,
83,
21,
796,
4704,
278,
13,
16818,
7,
16793,
28,
66,
23954,
11,
26498,
16193,
12924,
377,
330,
5488,
11,
27765,
62,
21973,
330,
5488,
11,
32317,
78,
11,
1188,
273,
11,
1451,
62,
9806,
11,
1312,
20,
11,
72,
21,
4008,
198,
197,
197,
197,
197,
83,
21,
13,
9688,
3419,
628,
197,
197,
197,
197,
83,
17,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
18,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
19,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
20,
13,
22179,
3419,
198,
197,
197,
197,
197,
83,
21,
13,
22179,
3419,
198,
197,
197,
197,
197,
361,
357,
83,
16,
13,
271,
62,
282,
425,
3419,
855,
83,
17,
13,
271,
62,
282,
425,
3419,
855,
83,
18,
13,
271,
62,
282,
425,
3419,
855,
83,
19,
13,
271,
62,
282,
425,
3419,
855,
83,
20,
13,
271,
62,
282,
425,
3419,
855,
83,
21,
13,
271,
62,
282,
425,
3419,
855,
25101,
2599,
198,
197,
197,
197,
197,
197,
12381,
16595,
330,
5488,
198,
197,
197,
197,
197,
197,
12924,
377,
330,
5488,
796,
299,
62,
12924,
377,
330,
5488,
628,
197,
197,
1362,
330,
5488,
62,
265,
723,
15853,
352,
198,
197,
197,
361,
27602,
330,
5488,
62,
265,
723,
6624,
3509,
62,
1362,
330,
5488,
25,
198,
197,
197,
197,
12924,
377,
330,
5488,
13,
30619,
7,
50188,
28,
17821,
8,
198,
197,
4798,
7203,
18709,
418,
25,
1600,
1429,
418,
8,
198,
197,
4798,
7203,
21102,
17899,
1540,
1229,
5488,
12379,
27602,
330,
5488,
33172,
27602,
330,
5488,
62,
265,
723,
12,
16,
8,
198,
197,
4798,
7203,
7762,
273,
25,
33172,
12924,
377,
330,
5488,
58,
15,
7131,
15,
17241,
38434,
78,
25,
33172,
12924,
377,
330,
5488,
58,
15,
7131,
16,
12962,
198,
197,
4798,
7203,
34,
398,
793,
17902,
1600,
16595,
330,
5488,
58,
15,
7131,
17,
25,
12962,
198,
198,
37811,
198,
11748,
4704,
278,
198,
6738,
18540,
305,
919,
278,
1330,
4670,
518,
198,
4299,
466,
7957,
7,
87,
11,
8358,
2599,
198,
197,
87,
796,
2124,
9,
87,
198,
197,
4188,
13,
1996,
7,
87,
8,
198,
197,
4798,
7,
87,
8,
198,
198,
36560,
16,
796,
4670,
518,
3419,
198,
83,
16,
796,
4704,
278,
13,
16818,
7,
16793,
28,
67,
672,
305,
11,
26498,
16193,
17,
11,
36560,
16,
4008,
198,
83,
16,
13,
9688,
3419,
198,
4798,
7,
83,
16,
8,
198,
2,
83,
16,
13,
22179,
3419,
198,
87,
796,
16834,
16,
13,
1136,
3419,
198,
4798,
7,
87,
8,
198,
4798,
7,
83,
16,
8,
198,
198,
37811
] | 1.867358 | 3,566 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-25 11:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
319,
2177,
12,
2998,
12,
1495,
1367,
25,
4310,
201,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
201,
198,
201,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
201,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
201,
198,
201,
198
] | 2.586667 | 75 |
# Generated by Django 3.0 on 2020-10-16 11:43
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
319,
12131,
12,
940,
12,
1433,
1367,
25,
3559,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
#!/usr/bin/env python
#
# Copyright @2014 [email protected]
# Licensed: see Python license
"""Utility module"""
import json
import uuid
import hashlib
from decimal import Decimal
from datetime import date, datetime
from tornado import concurrent, ioloop
from concurrent.futures import ThreadPoolExecutor
def generate_hash(password, random_key=None):
"""Membuat password hash dengan random key 'random_key' menggunakan sha512 dari hashlib"""
if not random_key:
random_key = uuid.uuid4().hex
hashed_pass = hashlib.sha512(str(password).encode() + random_key.encode()).hexdigest()
return hashed_pass, random_key
def verify_password(password, hashed_password, key):
"""Verify password"""
computed_hash, key = generate_hash(password, key)
return computed_hash == hashed_password
# Some data types we want to check for.
# Turn a good precise decimal into a more JavaScript-friendly float.
# Use an isoformat string for dates and times.
# # from http://nchls.com/post/serializing-complex-python-data-json/
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
2488,
4967,
2042,
15600,
14664,
2475,
31,
40774,
13,
785,
198,
2,
49962,
25,
766,
11361,
5964,
198,
198,
37811,
18274,
879,
8265,
37811,
198,
198,
11748,
33918,
198,
11748,
334,
27112,
198,
11748,
12234,
8019,
198,
198,
6738,
32465,
1330,
4280,
4402,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
6738,
33718,
1330,
24580,
11,
1312,
349,
11224,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
628,
198,
4299,
7716,
62,
17831,
7,
28712,
11,
4738,
62,
2539,
28,
14202,
2599,
198,
220,
220,
220,
37227,
13579,
11110,
265,
9206,
12234,
2853,
1030,
4738,
1994,
705,
25120,
62,
2539,
6,
1450,
1130,
403,
461,
272,
427,
64,
25836,
288,
2743,
12234,
8019,
37811,
198,
220,
220,
220,
611,
407,
4738,
62,
2539,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4738,
62,
2539,
796,
334,
27112,
13,
12303,
312,
19,
22446,
33095,
198,
220,
220,
220,
468,
704,
62,
6603,
796,
12234,
8019,
13,
26270,
25836,
7,
2536,
7,
28712,
737,
268,
8189,
3419,
1343,
4738,
62,
2539,
13,
268,
8189,
3419,
737,
33095,
12894,
395,
3419,
198,
220,
220,
220,
1441,
468,
704,
62,
6603,
11,
4738,
62,
2539,
628,
198,
4299,
11767,
62,
28712,
7,
28712,
11,
468,
704,
62,
28712,
11,
1994,
2599,
198,
220,
220,
220,
37227,
13414,
1958,
9206,
37811,
198,
220,
220,
220,
29231,
62,
17831,
11,
1994,
796,
7716,
62,
17831,
7,
28712,
11,
1994,
8,
198,
220,
220,
220,
1441,
29231,
62,
17831,
6624,
468,
704,
62,
28712,
628,
198,
2,
2773,
1366,
3858,
356,
765,
284,
2198,
329,
13,
628,
198,
198,
2,
6756,
257,
922,
7141,
32465,
656,
257,
517,
11933,
12,
13120,
12178,
13,
628,
198,
2,
5765,
281,
47279,
18982,
4731,
329,
9667,
290,
1661,
13,
628,
198,
2,
1303,
422,
2638,
1378,
77,
354,
7278,
13,
785,
14,
7353,
14,
46911,
2890,
12,
41887,
12,
29412,
12,
7890,
12,
17752,
14,
198
] | 3.151786 | 336 |
from main import summation,summation1
| [
6738,
1388,
1330,
30114,
341,
11,
82,
13929,
341,
16,
628
] | 3.545455 | 11 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# В строке могут присутствовать скобки как круглые, так и квадратные скобки. Каждой
# открывающей скобке соответствует закрывающая того же типа (круглой – круглая,
# квадратной- квадратная). Напишите рекурсивную функцию, проверяющую правильность
# расстановки скобок в этом случае.
if __name__ == '__main__':
# Проверка
print(task(input()))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
12466,
240,
220,
21727,
20375,
21169,
25443,
118,
16843,
12466,
120,
25443,
111,
35072,
20375,
12466,
123,
21169,
18849,
21727,
35072,
20375,
21727,
20375,
38857,
25443,
110,
16142,
20375,
45367,
220,
21727,
31583,
25443,
109,
31583,
18849,
12466,
118,
16142,
31583,
12466,
118,
21169,
35072,
140,
111,
30143,
45035,
16843,
11,
220,
20375,
16142,
31583,
12466,
116,
12466,
118,
38857,
16142,
43666,
21169,
16142,
20375,
22177,
45035,
16843,
220,
21727,
31583,
25443,
109,
31583,
18849,
13,
12466,
248,
16142,
140,
114,
43666,
25443,
117,
201,
198,
2,
12466,
122,
20375,
31583,
21169,
45035,
38857,
16142,
141,
236,
141,
231,
16843,
140,
117,
220,
21727,
31583,
25443,
109,
31583,
16843,
220,
21727,
15166,
15166,
20375,
38857,
16843,
20375,
21727,
20375,
38857,
35072,
16843,
20375,
12466,
115,
16142,
31583,
21169,
45035,
38857,
16142,
141,
236,
141,
231,
16142,
40623,
220,
20375,
25443,
111,
15166,
12466,
114,
16843,
220,
20375,
18849,
140,
123,
16142,
357,
31583,
21169,
35072,
140,
111,
30143,
25443,
117,
784,
12466,
118,
21169,
35072,
140,
111,
30143,
16142,
40623,
11,
201,
198,
2,
12466,
118,
38857,
16142,
43666,
21169,
16142,
20375,
22177,
25443,
117,
12,
12466,
118,
38857,
16142,
43666,
21169,
16142,
20375,
22177,
16142,
40623,
737,
12466,
251,
16142,
140,
123,
18849,
141,
230,
18849,
20375,
16843,
220,
21169,
16843,
31583,
35072,
21169,
21727,
18849,
38857,
22177,
35072,
141,
236,
220,
141,
226,
35072,
22177,
31583,
141,
228,
18849,
141,
236,
11,
12466,
123,
21169,
25443,
110,
16843,
21169,
40623,
141,
236,
141,
231,
35072,
141,
236,
12466,
123,
21169,
16142,
38857,
18849,
30143,
45367,
22177,
15166,
21727,
20375,
45367,
201,
198,
2,
220,
21169,
16142,
21727,
21727,
20375,
16142,
22177,
25443,
110,
31583,
18849,
220,
21727,
31583,
25443,
109,
25443,
118,
12466,
110,
220,
141,
235,
20375,
25443,
120,
220,
21727,
30143,
35072,
141,
229,
16142,
16843,
13,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
201,
198,
201,
198,
220,
220,
220,
1303,
12466,
253,
21169,
25443,
110,
16843,
21169,
31583,
16142,
201,
198,
201,
198,
201,
198,
220,
220,
220,
3601,
7,
35943,
7,
15414,
3419,
4008,
201,
198
] | 1.094987 | 379 |
from functools import partial, reduce
from itertools import chain, product
from math import sqrt
def cluster_iter(clustered, point, threshold):
"""Add a point to a grid-like cluster structure.
This allows comparing point distances only to clusters from nearby grids, not to all clusters. Useful when there are many clusters expected."""
coords, object_ = point
point_grid_cell = get_grid_cell(*coords, threshold=threshold)
nearby_grid_cells = get_nearby_grid_cells(point_grid_cell)
possible_nearby_cluster_locations = chain(
*[(location for location in clustered.get(grid_cell, {})) for grid_cell in nearby_grid_cells]
)
nearest_cluster_with_distance = reduce(nearest_location, possible_nearby_cluster_locations, None)
if nearest_cluster_with_distance:
nearest_cluster_location, _nearest_cluster_distance = nearest_cluster_with_distance
else:
nearest_cluster_location = None
if nearest_cluster_location:
cluster_grid_cell = get_grid_cell(*nearest_cluster_location, threshold=threshold)
cluster = clustered[cluster_grid_cell].pop(nearest_cluster_location)
cluster_object_count = len(cluster)
new_cluster_location = (
(nearest_cluster_location[0] * cluster_object_count + coords[0]) / (cluster_object_count + 1),
(nearest_cluster_location[1] * cluster_object_count + coords[1]) / (cluster_object_count + 1),
)
else:
cluster = []
new_cluster_location = coords
cluster.append(point)
new_cluster_grid_cell = get_grid_cell(*new_cluster_location, threshold=threshold)
clustered.setdefault(new_cluster_grid_cell, {})
clustered[new_cluster_grid_cell][new_cluster_location] = cluster
return clustered
def cluster(points, threshold):
"""Cluster points using distance-based clustering algorithm.
Arguments:
points — an iterable of two-element point tuples, each containing:
• a two-element tuple with X and Y coordinates,
• the actual object being clustered;
threshold — if a point is included into a cluster, it must be closer to its centroid than this value.
Return value:
an iterable of two-element cluster tuples, each containing:
• a two-element tuple with X and Y coordinates of the cluster centroid;
• a list of objects belonging to the cluster.
Cluster’s centroid is defined as average coordinates of the cluster’s members.
"""
cluster_iter_for_threshold = partial(cluster_iter, threshold=threshold)
clustered = reduce(cluster_iter_for_threshold, points, {})
return chain(
*[((location, [object_ for coords, object_ in points]) for location, points in grid_clusters.items())
for grid_clusters in clustered.values()]
)
| [
6738,
1257,
310,
10141,
1330,
13027,
11,
4646,
198,
6738,
340,
861,
10141,
1330,
6333,
11,
1720,
198,
6738,
10688,
1330,
19862,
17034,
628,
628,
198,
200,
198,
4299,
13946,
62,
2676,
7,
565,
436,
1068,
11,
966,
11,
11387,
2599,
198,
220,
220,
220,
37227,
4550,
257,
966,
284,
257,
10706,
12,
2339,
13946,
4645,
13,
628,
220,
220,
220,
770,
3578,
14176,
966,
18868,
691,
284,
23163,
422,
6716,
50000,
11,
407,
284,
477,
23163,
13,
49511,
618,
612,
389,
867,
23163,
2938,
526,
15931,
198,
220,
220,
220,
763,
3669,
11,
2134,
62,
796,
966,
198,
220,
220,
220,
966,
62,
25928,
62,
3846,
796,
651,
62,
25928,
62,
3846,
46491,
1073,
3669,
11,
11387,
28,
400,
10126,
8,
198,
220,
220,
220,
6716,
62,
25928,
62,
46342,
796,
651,
62,
40093,
1525,
62,
25928,
62,
46342,
7,
4122,
62,
25928,
62,
3846,
8,
198,
220,
220,
220,
1744,
62,
40093,
1525,
62,
565,
5819,
62,
17946,
602,
796,
6333,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1635,
58,
7,
24886,
329,
4067,
287,
49480,
13,
1136,
7,
25928,
62,
3846,
11,
23884,
4008,
329,
10706,
62,
3846,
287,
6716,
62,
25928,
62,
46342,
60,
198,
220,
220,
220,
1267,
628,
220,
220,
220,
16936,
62,
565,
5819,
62,
4480,
62,
30246,
796,
4646,
7,
710,
12423,
62,
24886,
11,
1744,
62,
40093,
1525,
62,
565,
5819,
62,
17946,
602,
11,
6045,
8,
198,
220,
220,
220,
611,
16936,
62,
565,
5819,
62,
4480,
62,
30246,
25,
198,
220,
220,
220,
220,
220,
220,
220,
16936,
62,
565,
5819,
62,
24886,
11,
4808,
710,
12423,
62,
565,
5819,
62,
30246,
796,
16936,
62,
565,
5819,
62,
4480,
62,
30246,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
16936,
62,
565,
5819,
62,
24886,
796,
6045,
628,
220,
220,
220,
611,
16936,
62,
565,
5819,
62,
24886,
25,
198,
220,
220,
220,
220,
220,
220,
220,
13946,
62,
25928,
62,
3846,
796,
651,
62,
25928,
62,
3846,
46491,
710,
12423,
62,
565,
5819,
62,
24886,
11,
11387,
28,
400,
10126,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13946,
796,
49480,
58,
565,
5819,
62,
25928,
62,
3846,
4083,
12924,
7,
710,
12423,
62,
565,
5819,
62,
24886,
8,
198,
220,
220,
220,
220,
220,
220,
220,
13946,
62,
15252,
62,
9127,
796,
18896,
7,
565,
5819,
8,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
565,
5819,
62,
24886,
796,
357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
710,
12423,
62,
565,
5819,
62,
24886,
58,
15,
60,
1635,
13946,
62,
15252,
62,
9127,
1343,
763,
3669,
58,
15,
12962,
1220,
357,
565,
5819,
62,
15252,
62,
9127,
1343,
352,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
710,
12423,
62,
565,
5819,
62,
24886,
58,
16,
60,
1635,
13946,
62,
15252,
62,
9127,
1343,
763,
3669,
58,
16,
12962,
1220,
357,
565,
5819,
62,
15252,
62,
9127,
1343,
352,
828,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
13946,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
565,
5819,
62,
24886,
796,
763,
3669,
198,
220,
220,
220,
13946,
13,
33295,
7,
4122,
8,
198,
220,
220,
220,
649,
62,
565,
5819,
62,
25928,
62,
3846,
796,
651,
62,
25928,
62,
3846,
46491,
3605,
62,
565,
5819,
62,
24886,
11,
11387,
28,
400,
10126,
8,
198,
220,
220,
220,
49480,
13,
2617,
12286,
7,
3605,
62,
565,
5819,
62,
25928,
62,
3846,
11,
23884,
8,
198,
220,
220,
220,
49480,
58,
3605,
62,
565,
5819,
62,
25928,
62,
3846,
7131,
3605,
62,
565,
5819,
62,
24886,
60,
796,
13946,
628,
220,
220,
220,
1441,
49480,
628,
200,
198,
4299,
13946,
7,
13033,
11,
11387,
2599,
198,
220,
220,
220,
37227,
2601,
5819,
2173,
1262,
5253,
12,
3106,
32966,
1586,
11862,
13,
628,
220,
220,
220,
20559,
2886,
25,
198,
220,
220,
220,
2173,
851,
281,
11629,
540,
286,
734,
12,
30854,
966,
12777,
2374,
11,
1123,
7268,
25,
198,
220,
220,
220,
220,
220,
5595,
257,
734,
12,
30854,
46545,
351,
1395,
290,
575,
22715,
11,
198,
220,
220,
220,
220,
220,
5595,
262,
4036,
2134,
852,
49480,
26,
198,
220,
220,
220,
11387,
851,
611,
257,
966,
318,
3017,
656,
257,
13946,
11,
340,
1276,
307,
5699,
284,
663,
1247,
3882,
621,
428,
1988,
13,
628,
220,
220,
220,
8229,
1988,
25,
198,
220,
220,
220,
281,
11629,
540,
286,
734,
12,
30854,
13946,
12777,
2374,
11,
1123,
7268,
25,
198,
220,
220,
220,
220,
220,
5595,
257,
734,
12,
30854,
46545,
351,
1395,
290,
575,
22715,
286,
262,
13946,
1247,
3882,
26,
198,
220,
220,
220,
220,
220,
5595,
257,
1351,
286,
5563,
16686,
284,
262,
13946,
13,
628,
220,
220,
220,
38279,
447,
247,
82,
1247,
3882,
318,
5447,
355,
2811,
22715,
286,
262,
13946,
447,
247,
82,
1866,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13946,
62,
2676,
62,
1640,
62,
400,
10126,
796,
13027,
7,
565,
5819,
62,
2676,
11,
11387,
28,
400,
10126,
8,
198,
220,
220,
220,
49480,
796,
4646,
7,
565,
5819,
62,
2676,
62,
1640,
62,
400,
10126,
11,
2173,
11,
23884,
8,
198,
220,
220,
220,
1441,
6333,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1635,
58,
19510,
24886,
11,
685,
15252,
62,
329,
763,
3669,
11,
2134,
62,
287,
2173,
12962,
329,
4067,
11,
2173,
287,
10706,
62,
565,
13654,
13,
23814,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
10706,
62,
565,
13654,
287,
49480,
13,
27160,
3419,
60,
198,
220,
220,
220,
1267,
198
] | 2.902287 | 962 |
from django.http import HttpResponse
from django.shortcuts import render, render_to_response, RequestContext
from uno.models import Question_m
from django.views.generic import FormView
from uno.forms import Question_f
import requests
#rom uno.info import information
from copy import deepcopy
from uno.a import info1 as information
#from django.template.defaulttags import register
pro = []
'''
@register.filter
def get_item(dictionary, key):
return dictionary.get(key)
'''
| [
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
201,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
8543,
62,
1462,
62,
26209,
11,
19390,
21947,
201,
198,
6738,
555,
78,
13,
27530,
1330,
18233,
62,
76,
201,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
5178,
7680,
201,
198,
6738,
555,
78,
13,
23914,
1330,
18233,
62,
69,
201,
198,
11748,
7007,
201,
198,
2,
398,
555,
78,
13,
10951,
1330,
1321,
201,
198,
6738,
4866,
1330,
2769,
30073,
201,
198,
6738,
555,
78,
13,
64,
1330,
7508,
16,
355,
1321,
201,
198,
2,
6738,
42625,
14208,
13,
28243,
13,
12286,
31499,
1330,
7881,
201,
198,
201,
198,
1676,
796,
17635,
201,
198,
7061,
6,
201,
198,
31,
30238,
13,
24455,
201,
198,
4299,
651,
62,
9186,
7,
67,
14188,
11,
1994,
2599,
201,
198,
220,
220,
220,
1441,
22155,
13,
1136,
7,
2539,
8,
201,
198,
7061,
6,
201,
198
] | 3.2 | 155 |
from .user_id import UserID
from .channel_id import ChannelID
from .enum_converter import EnumConverter
from .boolean_converter import BooleanConverter
from .colour_converter import ColourConverter
from .filtered_user import FilteredUser, FilteredMember
from .number_converter import NumberConverter
| [
6738,
764,
7220,
62,
312,
1330,
11787,
2389,
198,
6738,
764,
17620,
62,
312,
1330,
11102,
2389,
198,
6738,
764,
44709,
62,
1102,
332,
353,
1330,
2039,
388,
3103,
332,
353,
198,
6738,
764,
2127,
21052,
62,
1102,
332,
353,
1330,
41146,
3103,
332,
353,
198,
6738,
764,
49903,
62,
1102,
332,
353,
1330,
38773,
3103,
332,
353,
198,
6738,
764,
10379,
4400,
62,
7220,
1330,
7066,
4400,
12982,
11,
7066,
4400,
27608,
198,
6738,
764,
17618,
62,
1102,
332,
353,
1330,
7913,
3103,
332,
353,
198
] | 3.448276 | 87 |
import torch as t
from torch import nn
import math as m
import torchvision.models as models
import numpy as np
import matplotlib.pyplot as plt
import copy
'''neural_net.py: Custom network object deriving from nn.Module to track the architecture '''
__author__ = "Luis Quinones"
__email__ = "[email protected]"
__status__ = "Prototype"
class Neural_Network(nn.Module):
'''
The neural network object sits a level above the classifier to
store relevant properties and values. The classifier uses nn.LogSoftmax so use the
negative log likelihood loss criterion nn.NLLLoss
Args:
inputs (int): The number of inputs.
hidden_sizes (list of ints): The hidden layer sizes.
outputs (int): The number of outputs.
hidden_activation (str): The hidden layer activation functions (ex. relu, sigmoid, tahn).
device (str): The gpu or the cpu.
optimizer_name (str): The optimizer name ('sgd' or 'adam') to update the weights and gradients
dropout (float): The dropout rate, value to randomly drop input units through training.
learn_rate (float): The learning rate value, used along with the gradient to update the weights,
small values ensure that the weight update steps are small enough.
Attributes:
inputs (int): This is where we store the input count,
hidden_sizes (list of int): This is where we store the hidden layer sizes,
outputs (int): This is where we store the output size,
hidden_activation (str): This is where we store the hidden activation type,
dropout (float): This is where we store the random input unit dropout rate,
learn_rate (float): This is where we store the learn rate value,
processing_device (str): This is where we store the device to calculate the results,
linear_layers (list): This is where we store the values to sequentially build the classifier,
model (torch.nn.module or torchvision model): Where either the generated classifier or the loaded model is stored,
optimizer (torch.optim): This is where we store the optimizer used,
criterior (torch.nn.module.loss): This is where we store the loss function type,
device (str): This is where we store the device,
epochs_completed (int): This is where we store how many total epochs of training this model has.
'''
def generate_classifier(self):
'''Generates the nn.module container Sequential classfier as the default for this class.
Args:
None.
Raises:
TODO: Update exceptions with error_handling class.
Returns:
None.
'''
self.linear_layers = []
n = len(self.data)
for i in range(n-1):
self.linear_layers.append(nn.Linear(self.data[i],self.data[(i + 1) % n]))
if i != n-2:
if self.hidden_activation == 'relu':
self.linear_layers.append(nn.ReLU())
elif self.hidden_activation == 'sigmoid':
self.linear_layers.append(nn.Sigmoid())
elif self.hidden_activation == 'tanh':
self.linear_layers.append(nn.Tanh())
self.linear_layers.append(nn.Dropout(self.dropout))
self.linear_layers.append(nn.LogSoftmax(dim = 1))
# expand the list into sequential args
self.model = nn.Sequential(*self.linear_layers)
def train_network(self, train_data, validation_data, epochs = 1, load_best_params = False, plot = False):
'''Trains the model, requires the criterion and optimizer to be passed into the class args before hand.
TODO: add exception handling for optimizer and criterion as None values.
Args:
train_data (torch.utils.data.dataloader.DataLoader): The training torch data loader.
validation_data (torch.utils.data.dataloader.DataLoader): The validation torch data loader.
epochs (int): The number of epochs for training.
load_best_params (bool): If true then we will load the model_state_dict from the highest accuracy iteration
plot (bool): If true we plot both losses.
Raises:
TODO: Add exceptions.
Returns:
None.
'''
# move the model to whatever device we have
self.model.to(self.device)
# if we loaded the model in eval mode and want to train switch it
if not self.model.training:
self.model.train()
iteration, running_loss = 0, 0
highest_accuracy, high_acc_iter, high_acc_epoch = 0, 0, 0
training_loss_set, validation_loss_set = [], []
best_params = None
for epoch in range(epochs):
batch_iteration = 0
for x, y_labels in train_data:
# move to whatever device we have
x, y_labels = x.to(self.device), y_labels.to(self.device)
# zero out the gradients
self.optimizer.zero_grad()
# forward pass - get the log probabilities (logits / scores)
output = self.model(x)
# calculate the loss
loss = self.criterion(output, y_labels)
# backprop - calculate the gradients for the parameters
loss.backward()
# parameter update based on gradient
self.optimizer.step()
# update stats
running_loss += loss.item()
iteration += 1
batch_iteration += 1
else:
# Validation Process
validation_loss, accuracy = self.validate_network(validation_data)
training_loss = running_loss/len(train_data)
print('Model has a total of {} training epochs completed.'.format(self.epochs_completed))
print('Active session Epoch {} out of {}'.format(epoch + 1, epochs))
print('Currently model has Accuracy of {}% \nCurrent training loss is {} \
\nCurrent validation loss is {}'.format(accuracy,
training_loss, validation_loss))
training_loss_set.append(training_loss)
validation_loss_set.append(validation_loss)
print('-------------')
running_loss = 0
# Track best run
if accuracy > highest_accuracy:
highest_accuracy = accuracy
high_acc_iter = batch_iteration
high_acc_epoch = epoch + 1
if load_best_params:
best_params = copy.deepcopy(self.model.state_dict())
# Set the model back to train mode, enable dropout again
self.model.train()
self.epochs_completed += 1
t_slope, v_slope = self.check_overfitting(training_loss_set, validation_loss_set, plot)
print('Slope of linear reg training curve fit is {} \nSlope of linear reg Validation curve fit is {}'.format(t_slope,
v_slope))
print('Training session highest accuracy was {} on epoch {} batch iteration {}'.format(highest_accuracy,
high_acc_epoch,
high_acc_iter))
if load_best_params:
self.model.load_state_dict(best_params)
print('Params from {} epoch, {} batch iteration were loaded'.format(high_acc_epoch, high_acc_iter))
def validate_network(self, data):
'''Validate our model to check the loss and accuracy.
Args:
data (torch.utils.data.dataloader.DataLoader): The data we want to validate as torch data loader.
Raises:
TODO: Add exceptions.
Returns:
loss,accuracy (tuple): The loss and accuracy of the validation.
'''
# enable eval mode, turn off dropout
self.model.eval()
# turn off the gradients since we are not updating params
with t.no_grad():
batch_loss = 0
batch_accuracy = 0
# validation pass
for x, y_labels in data:
# move to device
x, y_labels = x.to(self.device), y_labels.to(self.device)
output = self.model(x)
# update loss and extract tensor as python float
batch_loss += self.criterion(output, y_labels).item()
# calculate the probability
probability = t.exp(output)
# get the top n indexes and values
_, top_class = probability.topk(1, dim=1)
# reshape top class to match label and get binary value from equals,
# check if the prediction matches label
equals = top_class == y_labels.view(*top_class.shape)
# have to convert byte tensor to float tensor and get accuracy
batch_accuracy += t.mean(equals.type(t.FloatTensor)).item()
test_accuracy = (batch_accuracy / len(data))*100
test_loss = batch_loss / len(data)
return test_loss, test_accuracy
def check_overfitting(self, train_losses, validation_losses, plot = False):
'''Validate our model to check the loss and accuracy
Args:
train_losses (list of floats): The list of training losses per epoch.
validation_losses (list of floats): The list of validation losses per epoch.
plot (bool): If true we plot both losses.
Raises:
TODO: Add exceptions.
Returns:
slopes (tuple): The slopes of the linear reg curve fits for both validation/training.
'''
# Data
tl_x_val = np.arange(0, len(train_losses))
vl_x_val = np.arange(0, len(validation_losses))
# To numpy
train_data = np.array([tl_x_val, train_losses])
validate_data = np.array([vl_x_val, validation_losses])
# Least squares polynomial fit.
train_slope, train_intercept = np.polyfit(train_data[0], train_data[1], 1)
validation_slope, validation_intercept = np.polyfit(validate_data[0], validate_data[1], 1)
if plot:
plt.plot(train_data[0], train_data[1], 'o', label='training loss')
plt.plot(validate_data[0], validate_data[1], 'o', label='validation loss')
plt.plot(train_data[0], train_intercept + train_slope*train_data[0], 'r', label='train_regg')
plt.plot(validate_data[0], validation_intercept + validation_slope*validate_data[0], 'r', label='val_regg')
plt.legend()
plt.show()
return train_slope, validation_slope
def save_model_checkpoint(self, full_path, training_class_to_idx):
'''Save the model checkpoint.
Args:
full_path (str): The full path to save the checkpoint to
training_class_to_idx (dic of ints): This is where we store the dictionary mapping the name of the class to the index (label)
Raises:
TODO: Add exceptions
Returns:
None
'''
net_data_dic = {'input_count': self.inputs,
'hidden_sizes': self.hidden_sizes,
'outputs': self.outputs,
'h_activation': self.hidden_activation,
'dropout': self.dropout,
'learn_rate': self.learn_rate,
'epochs_completed' : self.epochs_completed}
checkpoint = {'data' : net_data_dic,
'model' : self.model,
'classifier' : self.model.classifier,
'optimizer.state_dict' : self.optimizer.state_dict(),
'state_dict' : self.model.state_dict(),
'device' : self.device,
'class_to_idx': training_class_to_idx}
t.save (checkpoint, full_path)
| [
11748,
28034,
355,
256,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
10688,
355,
285,
198,
11748,
28034,
10178,
13,
27530,
355,
4981,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
4866,
198,
198,
7061,
6,
710,
1523,
62,
3262,
13,
9078,
25,
8562,
3127,
2134,
4587,
1412,
422,
299,
77,
13,
26796,
284,
2610,
262,
10959,
705,
7061,
198,
834,
9800,
834,
796,
366,
25596,
271,
29338,
1952,
1,
198,
834,
12888,
834,
796,
366,
2290,
271,
31,
23855,
3628,
47635,
13,
785,
1,
198,
834,
13376,
834,
796,
366,
19703,
8690,
1,
198,
198,
4871,
47986,
62,
26245,
7,
20471,
13,
26796,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
383,
17019,
3127,
2134,
10718,
257,
1241,
2029,
262,
1398,
7483,
284,
198,
220,
220,
220,
3650,
5981,
6608,
290,
3815,
13,
383,
1398,
7483,
3544,
299,
77,
13,
11187,
18380,
9806,
523,
779,
262,
220,
198,
220,
220,
220,
4633,
2604,
14955,
2994,
34054,
299,
77,
13,
45,
3069,
43,
793,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
17311,
357,
600,
2599,
383,
1271,
286,
17311,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7104,
62,
82,
4340,
357,
4868,
286,
493,
82,
2599,
383,
7104,
7679,
10620,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23862,
357,
600,
2599,
383,
1271,
286,
23862,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7104,
62,
48545,
357,
2536,
2599,
383,
7104,
7679,
14916,
5499,
357,
1069,
13,
823,
84,
11,
264,
17225,
1868,
11,
256,
15386,
737,
198,
220,
220,
220,
220,
220,
220,
220,
3335,
357,
2536,
2599,
383,
308,
19944,
393,
262,
42804,
13,
198,
220,
220,
220,
220,
220,
220,
220,
6436,
7509,
62,
3672,
357,
2536,
2599,
383,
6436,
7509,
1438,
19203,
82,
21287,
6,
393,
705,
324,
321,
11537,
284,
4296,
262,
19590,
290,
3915,
2334,
198,
220,
220,
220,
220,
220,
220,
220,
4268,
448,
357,
22468,
2599,
383,
4268,
448,
2494,
11,
1988,
284,
15456,
4268,
5128,
4991,
832,
3047,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2193,
62,
4873,
357,
22468,
2599,
383,
4673,
2494,
1988,
11,
973,
1863,
351,
262,
31312,
284,
4296,
262,
19590,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1402,
3815,
4155,
326,
262,
3463,
4296,
4831,
389,
1402,
1576,
13,
628,
220,
220,
220,
49213,
25,
198,
220,
220,
220,
220,
220,
220,
220,
17311,
357,
600,
2599,
770,
318,
810,
356,
3650,
262,
5128,
954,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7104,
62,
82,
4340,
357,
4868,
286,
493,
2599,
770,
318,
810,
356,
3650,
262,
7104,
7679,
10620,
11,
198,
220,
220,
220,
220,
220,
220,
220,
23862,
357,
600,
2599,
770,
318,
810,
356,
3650,
262,
5072,
2546,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7104,
62,
48545,
357,
2536,
2599,
770,
318,
810,
356,
3650,
262,
7104,
14916,
2099,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4268,
448,
357,
22468,
2599,
770,
318,
810,
356,
3650,
262,
4738,
5128,
4326,
4268,
448,
2494,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2193,
62,
4873,
357,
22468,
2599,
770,
318,
810,
356,
3650,
262,
2193,
2494,
1988,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7587,
62,
25202,
357,
2536,
2599,
770,
318,
810,
356,
3650,
262,
3335,
284,
15284,
262,
2482,
11,
198,
220,
220,
220,
220,
220,
220,
220,
14174,
62,
75,
6962,
357,
4868,
2599,
770,
318,
810,
356,
3650,
262,
3815,
284,
4726,
3746,
1382,
262,
1398,
7483,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
357,
13165,
354,
13,
20471,
13,
21412,
393,
28034,
10178,
2746,
2599,
6350,
2035,
262,
7560,
1398,
7483,
393,
262,
9639,
2746,
318,
8574,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6436,
7509,
357,
13165,
354,
13,
40085,
2599,
770,
318,
810,
356,
3650,
262,
6436,
7509,
973,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1955,
263,
1504,
357,
13165,
354,
13,
20471,
13,
21412,
13,
22462,
2599,
770,
318,
810,
356,
3650,
262,
2994,
2163,
2099,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3335,
357,
2536,
2599,
770,
318,
810,
356,
3650,
262,
3335,
11,
198,
220,
220,
220,
220,
220,
220,
220,
36835,
82,
62,
785,
16838,
357,
600,
2599,
770,
318,
810,
356,
3650,
703,
867,
2472,
36835,
82,
286,
3047,
428,
2746,
468,
13,
628,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
825,
7716,
62,
4871,
7483,
7,
944,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
8645,
689,
262,
299,
77,
13,
21412,
9290,
24604,
1843,
1398,
69,
959,
355,
262,
4277,
329,
428,
1398,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6045,
13,
628,
220,
220,
220,
220,
220,
220,
220,
7567,
2696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16926,
46,
25,
10133,
13269,
351,
4049,
62,
4993,
1359,
1398,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6045,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29127,
62,
75,
6962,
796,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
299,
796,
18896,
7,
944,
13,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
329,
1312,
287,
2837,
7,
77,
12,
16,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29127,
62,
75,
6962,
13,
33295,
7,
20471,
13,
14993,
451,
7,
944,
13,
7890,
58,
72,
4357,
944,
13,
7890,
58,
7,
72,
1343,
352,
8,
4064,
299,
60,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1312,
14512,
299,
12,
17,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2116,
13,
30342,
62,
48545,
6624,
705,
260,
2290,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29127,
62,
75,
6962,
13,
33295,
7,
20471,
13,
3041,
41596,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2116,
13,
30342,
62,
48545,
6624,
705,
82,
17225,
1868,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29127,
62,
75,
6962,
13,
33295,
7,
20471,
13,
50,
17225,
1868,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
2116,
13,
30342,
62,
48545,
6624,
705,
38006,
71,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29127,
62,
75,
6962,
13,
33295,
7,
20471,
13,
45557,
71,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29127,
62,
75,
6962,
13,
33295,
7,
20471,
13,
26932,
448,
7,
944,
13,
14781,
448,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
29127,
62,
75,
6962,
13,
33295,
7,
20471,
13,
11187,
18380,
9806,
7,
27740,
796,
352,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
4292,
262,
1351,
656,
35582,
26498,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19849,
796,
299,
77,
13,
44015,
1843,
46491,
944,
13,
29127,
62,
75,
6962,
8,
628,
220,
220,
220,
825,
4512,
62,
27349,
7,
944,
11,
4512,
62,
7890,
11,
21201,
62,
7890,
11,
36835,
82,
796,
352,
11,
3440,
62,
13466,
62,
37266,
796,
10352,
11,
7110,
796,
10352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
2898,
1299,
262,
2746,
11,
4433,
262,
34054,
290,
6436,
7509,
284,
307,
3804,
656,
262,
1398,
26498,
878,
1021,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16926,
46,
25,
751,
6631,
9041,
329,
6436,
7509,
290,
34054,
355,
6045,
3815,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
7890,
357,
13165,
354,
13,
26791,
13,
7890,
13,
67,
10254,
1170,
263,
13,
6601,
17401,
2599,
383,
3047,
28034,
1366,
40213,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21201,
62,
7890,
357,
13165,
354,
13,
26791,
13,
7890,
13,
67,
10254,
1170,
263,
13,
6601,
17401,
2599,
383,
21201,
28034,
1366,
40213,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
36835,
82,
357,
600,
2599,
383,
1271,
286,
36835,
82,
329,
3047,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3440,
62,
13466,
62,
37266,
357,
30388,
2599,
1002,
2081,
788,
356,
481,
3440,
262,
2746,
62,
5219,
62,
11600,
422,
262,
4511,
9922,
24415,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7110,
357,
30388,
2599,
1002,
2081,
356,
7110,
1111,
9089,
13,
628,
220,
220,
220,
220,
220,
220,
220,
7567,
2696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16926,
46,
25,
3060,
13269,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6045,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1445,
262,
2746,
284,
4232,
3335,
356,
423,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19849,
13,
1462,
7,
944,
13,
25202,
8,
628,
220,
220,
220,
220,
220,
220,
220,
1303,
611,
356,
9639,
262,
2746,
287,
5418,
4235,
290,
765,
284,
4512,
5078,
340,
198,
220,
220,
220,
220,
220,
220,
220,
611,
407,
2116,
13,
19849,
13,
34409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19849,
13,
27432,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
24415,
11,
2491,
62,
22462,
796,
657,
11,
657,
198,
220,
220,
220,
220,
220,
220,
220,
4511,
62,
4134,
23843,
11,
1029,
62,
4134,
62,
2676,
11,
1029,
62,
4134,
62,
538,
5374,
796,
657,
11,
657,
11,
657,
198,
220,
220,
220,
220,
220,
220,
220,
3047,
62,
22462,
62,
2617,
11,
21201,
62,
22462,
62,
2617,
796,
685,
4357,
17635,
198,
220,
220,
220,
220,
220,
220,
220,
1266,
62,
37266,
796,
6045,
628,
220,
220,
220,
220,
220,
220,
220,
329,
36835,
287,
2837,
7,
538,
5374,
82,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
2676,
341,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
2124,
11,
331,
62,
23912,
1424,
287,
4512,
62,
7890,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1445,
284,
4232,
3335,
356,
423,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
11,
331,
62,
23912,
1424,
796,
2124,
13,
1462,
7,
944,
13,
25202,
828,
331,
62,
23912,
1424,
13,
1462,
7,
944,
13,
25202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
6632,
503,
262,
3915,
2334,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
40085,
7509,
13,
22570,
62,
9744,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2651,
1208,
532,
651,
262,
2604,
39522,
357,
6404,
896,
1220,
8198,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
796,
2116,
13,
19849,
7,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
15284,
262,
2994,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2994,
796,
2116,
13,
22213,
28019,
7,
22915,
11,
331,
62,
23912,
1424,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
736,
22930,
532,
15284,
262,
3915,
2334,
329,
262,
10007,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2994,
13,
1891,
904,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
11507,
4296,
1912,
319,
31312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
40085,
7509,
13,
9662,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4296,
9756,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2491,
62,
22462,
15853,
2994,
13,
9186,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24415,
15853,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
2676,
341,
15853,
352,
628,
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,
3254,
24765,
10854,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21201,
62,
22462,
11,
9922,
796,
2116,
13,
12102,
378,
62,
27349,
7,
12102,
341,
62,
7890,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
62,
22462,
796,
2491,
62,
22462,
14,
11925,
7,
27432,
62,
7890,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
17633,
468,
257,
2472,
286,
23884,
3047,
36835,
82,
5668,
2637,
13,
18982,
7,
944,
13,
538,
5374,
82,
62,
785,
16838,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
13739,
6246,
4551,
5374,
23884,
503,
286,
23884,
4458,
18982,
7,
538,
5374,
1343,
352,
11,
36835,
82,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
21327,
2746,
468,
33222,
286,
23884,
4,
3467,
77,
11297,
3047,
2994,
318,
23884,
3467,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3467,
77,
11297,
21201,
2994,
318,
23884,
4458,
18982,
7,
4134,
23843,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
62,
22462,
11,
21201,
62,
22462,
4008,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
62,
22462,
62,
2617,
13,
33295,
7,
34409,
62,
22462,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21201,
62,
22462,
62,
2617,
13,
33295,
7,
12102,
341,
62,
22462,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
32501,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2491,
62,
22462,
796,
657,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
17762,
1266,
1057,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
9922,
1875,
4511,
62,
4134,
23843,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4511,
62,
4134,
23843,
796,
9922,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
4134,
62,
2676,
796,
15458,
62,
2676,
341,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
4134,
62,
538,
5374,
796,
36835,
1343,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
3440,
62,
13466,
62,
37266,
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,
1266,
62,
37266,
796,
4866,
13,
22089,
30073,
7,
944,
13,
19849,
13,
5219,
62,
11600,
28955,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
5345,
262,
2746,
736,
284,
4512,
4235,
11,
7139,
4268,
448,
757,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19849,
13,
27432,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
538,
5374,
82,
62,
785,
16838,
15853,
352,
628,
220,
220,
220,
220,
220,
220,
220,
256,
62,
6649,
3008,
11,
410,
62,
6649,
3008,
796,
2116,
13,
9122,
62,
2502,
32232,
7,
34409,
62,
22462,
62,
2617,
11,
21201,
62,
22462,
62,
2617,
11,
7110,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
11122,
3008,
286,
14174,
842,
3047,
12133,
4197,
318,
23884,
3467,
77,
11122,
3008,
286,
14174,
842,
3254,
24765,
12133,
4197,
318,
23884,
4458,
18982,
7,
83,
62,
6649,
3008,
11,
220,
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,
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,
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,
220,
410,
62,
6649,
3008,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
44357,
6246,
4511,
9922,
373,
23884,
319,
36835,
23884,
15458,
24415,
23884,
4458,
18982,
7,
35323,
62,
4134,
23843,
11,
220,
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,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
4134,
62,
538,
5374,
11,
220,
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,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1029,
62,
4134,
62,
2676,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
611,
3440,
62,
13466,
62,
37266,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19849,
13,
2220,
62,
5219,
62,
11600,
7,
13466,
62,
37266,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
10044,
4105,
422,
23884,
36835,
11,
23884,
15458,
24415,
547,
9639,
4458,
18982,
7,
8929,
62,
4134,
62,
538,
5374,
11,
1029,
62,
4134,
62,
2676,
4008,
628,
220,
220,
220,
825,
26571,
62,
27349,
7,
944,
11,
1366,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
7762,
20540,
674,
2746,
284,
2198,
262,
2994,
290,
9922,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
357,
13165,
354,
13,
26791,
13,
7890,
13,
67,
10254,
1170,
263,
13,
6601,
17401,
2599,
383,
1366,
356,
765,
284,
26571,
355,
28034,
1366,
40213,
13,
628,
220,
220,
220,
220,
220,
220,
220,
7567,
2696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16926,
46,
25,
3060,
13269,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2994,
11,
4134,
23843,
357,
83,
29291,
2599,
383,
2994,
290,
9922,
286,
262,
21201,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
7139,
5418,
4235,
11,
1210,
572,
4268,
448,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
19849,
13,
18206,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1210,
572,
262,
3915,
2334,
1201,
356,
389,
407,
19698,
42287,
198,
220,
220,
220,
220,
220,
220,
220,
351,
256,
13,
3919,
62,
9744,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
22462,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
4134,
23843,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
21201,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
2124,
11,
331,
62,
23912,
1424,
287,
1366,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
1445,
284,
3335,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
11,
331,
62,
23912,
1424,
796,
2124,
13,
1462,
7,
944,
13,
25202,
828,
331,
62,
23912,
1424,
13,
1462,
7,
944,
13,
25202,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
796,
2116,
13,
19849,
7,
87,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4296,
2994,
290,
7925,
11192,
273,
355,
21015,
12178,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
22462,
15853,
2116,
13,
22213,
28019,
7,
22915,
11,
331,
62,
23912,
1424,
737,
9186,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
15284,
262,
12867,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12867,
796,
256,
13,
11201,
7,
22915,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
651,
262,
1353,
299,
39199,
290,
3815,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
11,
1353,
62,
4871,
796,
12867,
13,
4852,
74,
7,
16,
11,
5391,
28,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
27179,
1758,
1353,
1398,
284,
2872,
6167,
290,
651,
13934,
1988,
422,
21767,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
2198,
611,
262,
17724,
7466,
6167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21767,
796,
1353,
62,
4871,
6624,
331,
62,
23912,
1424,
13,
1177,
46491,
4852,
62,
4871,
13,
43358,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
423,
284,
10385,
18022,
11192,
273,
284,
12178,
11192,
273,
290,
651,
9922,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15458,
62,
4134,
23843,
15853,
256,
13,
32604,
7,
4853,
874,
13,
4906,
7,
83,
13,
43879,
51,
22854,
29720,
9186,
3419,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
4134,
23843,
796,
357,
43501,
62,
4134,
23843,
1220,
18896,
7,
7890,
4008,
9,
3064,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1332,
62,
22462,
796,
15458,
62,
22462,
1220,
18896,
7,
7890,
8,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
1332,
62,
22462,
11,
1332,
62,
4134,
23843,
198,
220,
220,
220,
220,
198,
220,
220,
220,
825,
2198,
62,
2502,
32232,
7,
944,
11,
4512,
62,
22462,
274,
11,
21201,
62,
22462,
274,
11,
7110,
796,
10352,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
7762,
20540,
674,
2746,
284,
2198,
262,
2994,
290,
9922,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
22462,
274,
357,
4868,
286,
36016,
2599,
383,
1351,
286,
3047,
9089,
583,
36835,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21201,
62,
22462,
274,
357,
4868,
286,
36016,
2599,
383,
1351,
286,
21201,
9089,
583,
36835,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7110,
357,
30388,
2599,
1002,
2081,
356,
7110,
1111,
9089,
13,
628,
220,
220,
220,
220,
220,
220,
220,
7567,
2696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16926,
46,
25,
3060,
13269,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
35082,
357,
83,
29291,
2599,
383,
35082,
286,
262,
14174,
842,
12133,
11414,
329,
1111,
21201,
14,
34409,
13,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
6060,
220,
198,
220,
220,
220,
220,
220,
220,
220,
256,
75,
62,
87,
62,
2100,
796,
45941,
13,
283,
858,
7,
15,
11,
18896,
7,
27432,
62,
22462,
274,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
410,
75,
62,
87,
62,
2100,
796,
45941,
13,
283,
858,
7,
15,
11,
18896,
7,
12102,
341,
62,
22462,
274,
4008,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1675,
299,
32152,
198,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
7890,
796,
45941,
13,
18747,
26933,
28781,
62,
87,
62,
2100,
11,
4512,
62,
22462,
274,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
26571,
62,
7890,
796,
45941,
13,
18747,
26933,
19279,
62,
87,
62,
2100,
11,
21201,
62,
22462,
274,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
1004,
459,
24438,
745,
6213,
49070,
4197,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4512,
62,
6649,
3008,
11,
4512,
62,
3849,
984,
796,
45941,
13,
35428,
11147,
7,
27432,
62,
7890,
58,
15,
4357,
4512,
62,
7890,
58,
16,
4357,
352,
8,
198,
220,
220,
220,
220,
220,
220,
220,
21201,
62,
6649,
3008,
11,
21201,
62,
3849,
984,
796,
45941,
13,
35428,
11147,
7,
12102,
378,
62,
7890,
58,
15,
4357,
26571,
62,
7890,
58,
16,
4357,
352,
8,
628,
220,
220,
220,
220,
220,
220,
220,
611,
7110,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
27432,
62,
7890,
58,
15,
4357,
4512,
62,
7890,
58,
16,
4357,
705,
78,
3256,
6167,
11639,
34409,
2994,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
12102,
378,
62,
7890,
58,
15,
4357,
26571,
62,
7890,
58,
16,
4357,
705,
78,
3256,
6167,
11639,
12102,
341,
2994,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
27432,
62,
7890,
58,
15,
4357,
4512,
62,
3849,
984,
1343,
4512,
62,
6649,
3008,
9,
27432,
62,
7890,
58,
15,
4357,
705,
81,
3256,
6167,
11639,
27432,
62,
260,
1130,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
29487,
7,
12102,
378,
62,
7890,
58,
15,
4357,
21201,
62,
3849,
984,
1343,
21201,
62,
6649,
3008,
9,
12102,
378,
62,
7890,
58,
15,
4357,
705,
81,
3256,
6167,
11639,
2100,
62,
260,
1130,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
1455,
437,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
458,
83,
13,
12860,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
4512,
62,
6649,
3008,
11,
21201,
62,
6649,
3008,
628,
220,
220,
220,
825,
3613,
62,
19849,
62,
9122,
4122,
7,
944,
11,
1336,
62,
6978,
11,
3047,
62,
4871,
62,
1462,
62,
312,
87,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
16928,
262,
2746,
26954,
13,
628,
220,
220,
220,
220,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1336,
62,
6978,
357,
2536,
2599,
383,
1336,
3108,
284,
3613,
262,
26954,
284,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3047,
62,
4871,
62,
1462,
62,
312,
87,
357,
67,
291,
286,
493,
82,
2599,
770,
318,
810,
356,
3650,
262,
22155,
16855,
262,
1438,
286,
262,
1398,
284,
262,
6376,
357,
18242,
8,
628,
220,
220,
220,
220,
220,
220,
220,
7567,
2696,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16926,
46,
25,
3060,
13269,
628,
220,
220,
220,
220,
220,
220,
220,
16409,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
2010,
62,
7890,
62,
67,
291,
796,
1391,
6,
15414,
62,
9127,
10354,
2116,
13,
15414,
82,
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,
705,
30342,
62,
82,
4340,
10354,
2116,
13,
30342,
62,
82,
4340,
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,
705,
22915,
82,
10354,
2116,
13,
22915,
82,
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,
705,
71,
62,
48545,
10354,
2116,
13,
30342,
62,
48545,
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,
705,
14781,
448,
10354,
2116,
13,
14781,
448,
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,
705,
35720,
62,
4873,
10354,
2116,
13,
35720,
62,
4873,
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,
705,
538,
5374,
82,
62,
785,
16838,
6,
1058,
2116,
13,
538,
5374,
82,
62,
785,
16838,
92,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
26954,
796,
1391,
6,
7890,
6,
1058,
2010,
62,
7890,
62,
67,
291,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
19849,
6,
1058,
2116,
13,
19849,
11,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
4871,
7483,
6,
1058,
2116,
13,
19849,
13,
4871,
7483,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
40085,
7509,
13,
5219,
62,
11600,
6,
1058,
2116,
13,
40085,
7509,
13,
5219,
62,
11600,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
5219,
62,
11600,
6,
1058,
2116,
13,
19849,
13,
5219,
62,
11600,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
25202,
6,
1058,
2116,
13,
25202,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
4871,
62,
1462,
62,
312,
87,
10354,
3047,
62,
4871,
62,
1462,
62,
312,
87,
92,
628,
220,
220,
220,
220,
220,
220,
220,
256,
13,
21928,
357,
9122,
4122,
11,
1336,
62,
6978,
8,
628,
198
] | 2.182765 | 5,663 |
import argparse
import logging
import os
import unittest
from keras.layers import recurrent
import numpy as np
from shcomplete.model2correct import Seq2seq, generate_model, get_chars, train_correct
from shcomplete.model2correct import generator_misprints, dislpay_sample_correction
if __name__ == '__main__':
unittest.main()
| [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
42465,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
427,
20751,
13,
19849,
17,
30283,
1330,
1001,
80,
17,
41068,
11,
7716,
62,
19849,
11,
651,
62,
354,
945,
11,
4512,
62,
30283,
198,
6738,
427,
20751,
13,
19849,
17,
30283,
1330,
17301,
62,
25413,
17190,
11,
19621,
15577,
62,
39873,
62,
10215,
8243,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 3.284314 | 102 |
import unittest
from draftjs_exporter.error import ConfigException
from draftjs_exporter.options import Options
| [
11748,
555,
715,
395,
198,
198,
6738,
4538,
8457,
62,
1069,
26634,
13,
18224,
1330,
17056,
16922,
198,
6738,
4538,
8457,
62,
1069,
26634,
13,
25811,
1330,
18634,
628
] | 3.931034 | 29 |
import unittest
from zope.testing import doctest, module
import zc.set
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
| [
11748,
555,
715,
395,
198,
198,
6738,
1976,
3008,
13,
33407,
1330,
10412,
395,
11,
8265,
198,
11748,
1976,
66,
13,
2617,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
7,
12286,
14402,
11639,
9288,
62,
2385,
578,
11537,
198
] | 2.735849 | 53 |
import os
import tarfile
output = os.path.splitext(input)[0]
try:
os.makedirs(output)
except OSError:
if not os.path.exists(output):
raise
with tarfile.open(input, 'r') as tf:
tf.extractall(output)
| [
11748,
28686,
198,
11748,
13422,
7753,
628,
198,
22915,
796,
28686,
13,
6978,
13,
22018,
578,
742,
7,
15414,
38381,
15,
60,
198,
198,
28311,
25,
198,
220,
220,
220,
28686,
13,
76,
4335,
17062,
7,
22915,
8,
198,
16341,
440,
5188,
81,
1472,
25,
198,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
1069,
1023,
7,
22915,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
5298,
198,
198,
4480,
13422,
7753,
13,
9654,
7,
15414,
11,
705,
81,
11537,
355,
48700,
25,
198,
220,
220,
220,
48700,
13,
2302,
974,
439,
7,
22915,
8,
198
] | 2.265306 | 98 |
import enum
import struct
from .abstract import AbstractNode
from .utils import ValuedNodeMixin, NodeContext
| [
11748,
33829,
198,
11748,
2878,
198,
198,
6738,
764,
397,
8709,
1330,
27741,
19667,
198,
6738,
764,
26791,
1330,
3254,
1739,
19667,
35608,
259,
11,
19081,
21947,
628,
628,
628,
628
] | 3.774194 | 31 |
from gevent import monkey
monkey.patch_time()
monkey.patch_socket()
import abc
import datetime
import time
from rx.concurrency.eventloopscheduler import EventLoopScheduler
from rx.concurrency.historicalscheduler import HistoricalScheduler
from rx.concurrency.mainloopscheduler import GEventScheduler
from rx.concurrency.newthreadscheduler import NewThreadScheduler
from algotrader.trading.event import MarketDataEventHandler
from algotrader.utils.logging import logger
from algotrader.utils.date import unixtimemillis_to_datetime
from algotrader import Startable, HasId, Context
| [
6738,
4903,
1151,
1330,
21657,
198,
198,
49572,
13,
17147,
62,
2435,
3419,
198,
49572,
13,
17147,
62,
44971,
3419,
198,
198,
11748,
450,
66,
198,
11748,
4818,
8079,
198,
11748,
640,
198,
198,
6738,
374,
87,
13,
1102,
34415,
13,
15596,
26268,
1416,
704,
18173,
1330,
8558,
39516,
50,
1740,
18173,
198,
6738,
374,
87,
13,
1102,
34415,
13,
10034,
12409,
1416,
704,
18173,
1330,
23121,
50,
1740,
18173,
198,
6738,
374,
87,
13,
1102,
34415,
13,
12417,
26268,
1416,
704,
18173,
1330,
402,
9237,
50,
1740,
18173,
198,
6738,
374,
87,
13,
1102,
34415,
13,
3605,
16663,
1416,
704,
18173,
1330,
968,
16818,
50,
1740,
18173,
198,
198,
6738,
435,
23442,
81,
5067,
13,
2213,
4980,
13,
15596,
1330,
5991,
6601,
9237,
25060,
198,
6738,
435,
23442,
81,
5067,
13,
26791,
13,
6404,
2667,
1330,
49706,
198,
6738,
435,
23442,
81,
5067,
13,
26791,
13,
4475,
1330,
555,
6346,
320,
368,
359,
271,
62,
1462,
62,
19608,
8079,
198,
6738,
435,
23442,
81,
5067,
1330,
7253,
540,
11,
7875,
7390,
11,
30532,
628,
628,
628
] | 3.322034 | 177 |
# coding: utf-8
# Node class based on the book "Inteligencia Artificial - Fundamentos, práctica y aplicaciones" by Alberto García Serrano | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
19081,
1398,
1912,
319,
262,
1492,
366,
24123,
9324,
33743,
35941,
532,
7557,
3263,
418,
11,
778,
6557,
28914,
331,
257,
489,
291,
49443,
274,
1,
416,
40649,
16364,
29690,
2930,
35823
] | 3.341463 | 41 |
numero = int(input("Fatorial de: ") )
resultado=1
count=1
while count <= numero:
resultado *= count
count --1
print(resultado)
| [
22510,
3529,
796,
493,
7,
15414,
7203,
37,
21592,
390,
25,
366,
8,
1267,
198,
198,
20274,
4533,
28,
16,
198,
9127,
28,
16,
198,
198,
4514,
954,
19841,
997,
3529,
25,
198,
220,
220,
220,
1255,
4533,
1635,
28,
954,
198,
220,
220,
220,
954,
1377,
16,
198,
198,
4798,
7,
20274,
4533,
8,
198
] | 2.464286 | 56 |
import torch
import os
import torch.nn as nn
import logging
import time
from sklearn.metrics import f1_score, classification_report, confusion_matrix
from transformers import BertForSequenceClassification
| [
11748,
28034,
198,
11748,
28686,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
18931,
198,
11748,
640,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
277,
16,
62,
26675,
11,
17923,
62,
13116,
11,
10802,
62,
6759,
8609,
198,
6738,
6121,
364,
1330,
22108,
1890,
44015,
594,
9487,
2649,
628
] | 3.961538 | 52 |
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import cv2
numDem=500
numRep=500
numColumns=50
numRows=50
numGrid=numColumns*numRows
windowSize=3
kernel=np.ones((windowSize,windowSize))
kernel[(windowSize-1)/2,(windowSize-1)/2]=0
numIter=100
valueThreshold=0.375*((windowSize**2)-1) #Slightly xenophilic, 37.5% corresponds to a threshold of 3
populationGrid=randomPopulationGrid()
emptyHouses=np.asarray(np.asarray(np.where(populationGrid==0)).transpose())
print(np.shape(emptyHouses))
cv2.namedWindow('Population Grid')
cv2.namedWindow('Dem Value Grid')
cv2.namedWindow('Rep Value Grid')
for iter in range(0,numIter):
print("Iteration "+ str(iter))
populationGridOne=np.copy(populationGrid)
populationGridOne[np.where(populationGridOne==-1)]=0 #Masking out opposition
populationGridNegativeOne=np.copy(populationGrid)
populationGridNegativeOne[np.where(populationGridNegativeOne==1)]=0 #Masking out opposition
valueGridOne=signal.fftconvolve(populationGridOne, kernel, mode='same')#gives a map of the number of similar individuals -satisfaction
valueGridNegativeOne=-1*signal.fftconvolve(populationGridNegativeOne, kernel, mode='same')#gives a map of the number of dissimilar individuals -satisfaction
cv2.imshow('Dem Value Grid', (valueGridOne)/((windowSize**2)-1))
cv2.imshow('Rep Value Grid', (valueGridNegativeOne)/((windowSize**2)-1))
cv2.imshow('Population Grid', visualMap(populationGrid))
cv2.waitKey(1)
repopulationGrid=populationGrid
if((iter%10)==0):
cv2.imwrite('iteration'+str(iter)+'.bmp', visualMap(populationGrid)*(2**8))
numSatisfied=0
for i in range(0,numRows):
for j in range(0,numColumns):
if(repopulationGrid[i,j]==1):
valueGrid=valueGridOne
if(repopulationGrid[i,j]==-1):
valueGrid=valueGridNegativeOne
if(repopulationGrid[i,j]==0 or valueGrid[i,j]>valueThreshold):
numSatisfied+=1
continue
numSatisfied+=1
emptyIndex=np.random.randint(0,numGrid-numDem-numRep)
shiftIndex=emptyHouses[emptyIndex][:]
repopulationGrid[i,j], repopulationGrid[shiftIndex[0],shiftIndex[1]]=repopulationGrid[shiftIndex[0],shiftIndex[1]], repopulationGrid[i,j]
emptyHouses[0:-1,:]=np.append(emptyHouses[0:emptyIndex,:], emptyHouses[emptyIndex+1:,:], axis=0)
emptyHouses[-1,:]=(np.array([i, j]))
populationGrid=repopulationGrid
cv2.imwrite('iteration99.bmp', visualMap(populationGrid)*(2**8))
cv2.waitKey()
cv2.destroyAllWindows()
| [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
6737,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
269,
85,
17,
198,
198,
22510,
11522,
28,
4059,
198,
22510,
6207,
28,
4059,
198,
198,
22510,
39470,
82,
28,
1120,
198,
22510,
49,
1666,
28,
1120,
198,
198,
22510,
41339,
28,
22510,
39470,
82,
9,
22510,
49,
1666,
198,
198,
17497,
10699,
28,
18,
198,
198,
33885,
28,
37659,
13,
1952,
19510,
17497,
10699,
11,
17497,
10699,
4008,
198,
33885,
58,
7,
17497,
10699,
12,
16,
20679,
17,
11,
7,
17497,
10699,
12,
16,
20679,
17,
22241,
15,
198,
198,
22510,
29993,
28,
3064,
198,
198,
8367,
817,
10126,
28,
15,
13,
22318,
9,
19510,
17497,
10699,
1174,
17,
13219,
16,
8,
1303,
50,
30945,
27132,
2522,
41896,
11,
5214,
13,
20,
4,
24866,
284,
257,
11387,
286,
513,
198,
198,
39748,
41339,
28,
25120,
45251,
41339,
3419,
198,
28920,
39,
11370,
28,
37659,
13,
292,
18747,
7,
37659,
13,
292,
18747,
7,
37659,
13,
3003,
7,
39748,
41339,
855,
15,
29720,
7645,
3455,
28955,
198,
4798,
7,
37659,
13,
43358,
7,
28920,
39,
11370,
4008,
198,
198,
33967,
17,
13,
13190,
27703,
10786,
45251,
24846,
11537,
198,
33967,
17,
13,
13190,
27703,
10786,
11522,
11052,
24846,
11537,
198,
33967,
17,
13,
13190,
27703,
10786,
6207,
11052,
24846,
11537,
198,
198,
1640,
11629,
287,
2837,
7,
15,
11,
22510,
29993,
2599,
198,
197,
4798,
7203,
29993,
341,
43825,
965,
7,
2676,
4008,
628,
197,
39748,
41339,
3198,
28,
37659,
13,
30073,
7,
39748,
41339,
8,
198,
197,
39748,
41339,
3198,
58,
37659,
13,
3003,
7,
39748,
41339,
3198,
855,
12,
16,
15437,
28,
15,
197,
2,
44,
30463,
503,
5471,
198,
197,
198,
197,
39748,
41339,
32863,
876,
3198,
28,
37659,
13,
30073,
7,
39748,
41339,
8,
198,
197,
39748,
41339,
32863,
876,
3198,
58,
37659,
13,
3003,
7,
39748,
41339,
32863,
876,
3198,
855,
16,
15437,
28,
15,
197,
2,
44,
30463,
503,
5471,
628,
197,
8367,
41339,
3198,
28,
12683,
282,
13,
487,
83,
42946,
6442,
7,
39748,
41339,
3198,
11,
9720,
11,
4235,
11639,
31642,
11537,
2,
70,
1083,
257,
3975,
286,
262,
1271,
286,
2092,
3925,
532,
82,
17403,
2673,
198,
197,
8367,
41339,
32863,
876,
3198,
10779,
16,
9,
12683,
282,
13,
487,
83,
42946,
6442,
7,
39748,
41339,
32863,
876,
3198,
11,
9720,
11,
4235,
11639,
31642,
11537,
2,
70,
1083,
257,
3975,
286,
262,
1271,
286,
6249,
49941,
3925,
532,
82,
17403,
2673,
198,
197,
197,
198,
197,
33967,
17,
13,
320,
12860,
10786,
11522,
11052,
24846,
3256,
357,
8367,
41339,
3198,
20679,
19510,
17497,
10699,
1174,
17,
13219,
16,
4008,
198,
197,
33967,
17,
13,
320,
12860,
10786,
6207,
11052,
24846,
3256,
357,
8367,
41339,
32863,
876,
3198,
20679,
19510,
17497,
10699,
1174,
17,
13219,
16,
4008,
198,
197,
33967,
17,
13,
320,
12860,
10786,
45251,
24846,
3256,
5874,
13912,
7,
39748,
41339,
4008,
198,
197,
198,
197,
33967,
17,
13,
17077,
9218,
7,
16,
8,
628,
197,
7856,
404,
1741,
41339,
28,
39748,
41339,
628,
197,
361,
19510,
2676,
4,
940,
8,
855,
15,
2599,
198,
197,
197,
33967,
17,
13,
320,
13564,
10786,
2676,
341,
6,
10,
2536,
7,
2676,
47762,
4458,
65,
3149,
3256,
5874,
13912,
7,
39748,
41339,
27493,
7,
17,
1174,
23,
4008,
198,
197,
198,
197,
22510,
50,
17403,
798,
28,
15,
198,
197,
1640,
1312,
287,
2837,
7,
15,
11,
22510,
49,
1666,
2599,
198,
197,
197,
1640,
474,
287,
2837,
7,
15,
11,
22510,
39470,
82,
2599,
628,
197,
197,
197,
361,
7,
7856,
404,
1741,
41339,
58,
72,
11,
73,
60,
855,
16,
2599,
198,
197,
197,
197,
197,
8367,
41339,
28,
8367,
41339,
3198,
197,
198,
197,
197,
198,
197,
197,
197,
361,
7,
7856,
404,
1741,
41339,
58,
72,
11,
73,
60,
855,
12,
16,
2599,
198,
197,
197,
197,
197,
8367,
41339,
28,
8367,
41339,
32863,
876,
3198,
198,
197,
197,
197,
198,
197,
197,
197,
361,
7,
7856,
404,
1741,
41339,
58,
72,
11,
73,
60,
855,
15,
393,
1988,
41339,
58,
72,
11,
73,
60,
29,
8367,
817,
10126,
2599,
198,
197,
197,
197,
197,
22510,
50,
17403,
798,
47932,
16,
198,
197,
197,
197,
197,
43043,
628,
197,
197,
197,
22510,
50,
17403,
798,
47932,
16,
198,
197,
198,
197,
197,
197,
28920,
15732,
28,
37659,
13,
25120,
13,
25192,
600,
7,
15,
11,
22510,
41339,
12,
22510,
11522,
12,
22510,
6207,
8,
198,
197,
197,
197,
30846,
15732,
28,
28920,
39,
11370,
58,
28920,
15732,
7131,
47715,
628,
197,
197,
197,
7856,
404,
1741,
41339,
58,
72,
11,
73,
4357,
1128,
404,
1741,
41339,
58,
30846,
15732,
58,
15,
4357,
30846,
15732,
58,
16,
11907,
28,
7856,
404,
1741,
41339,
58,
30846,
15732,
58,
15,
4357,
30846,
15732,
58,
16,
60,
4357,
1128,
404,
1741,
41339,
58,
72,
11,
73,
60,
628,
197,
197,
197,
28920,
39,
11370,
58,
15,
21912,
16,
11,
25,
22241,
37659,
13,
33295,
7,
28920,
39,
11370,
58,
15,
25,
28920,
15732,
11,
25,
4357,
6565,
39,
11370,
58,
28920,
15732,
10,
16,
45299,
25,
4357,
16488,
28,
15,
8,
198,
197,
197,
197,
28920,
39,
11370,
58,
12,
16,
11,
47715,
16193,
37659,
13,
18747,
26933,
72,
11,
474,
60,
4008,
628,
197,
197,
197,
39748,
41339,
28,
7856,
404,
1741,
41339,
198,
198,
33967,
17,
13,
320,
13564,
10786,
2676,
341,
2079,
13,
65,
3149,
3256,
5874,
13912,
7,
39748,
41339,
27493,
7,
17,
1174,
23,
4008,
198,
198,
33967,
17,
13,
17077,
9218,
3419,
198,
33967,
17,
13,
41659,
3237,
11209,
3419,
198
] | 2.644468 | 931 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# download some test data to run example notebook
#
# Author: M. Giomi ([email protected])
import os
from urllib.request import urlretrieve
from shutil import unpack_archive
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
4321,
617,
1332,
1366,
284,
1057,
1672,
20922,
198,
2,
198,
2,
6434,
25,
337,
13,
8118,
12753,
357,
6759,
660,
78,
13,
12397,
12753,
31,
8906,
88,
13,
2934,
8,
198,
198,
11748,
28686,
198,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
1186,
30227,
198,
6738,
4423,
346,
1330,
555,
8002,
62,
17474,
628,
198
] | 2.72619 | 84 |
import plasma
import plasmafx
from plasmafx import plugins
import time
FPS = 60
NUM_LIGHTS = 10
plasma.set_light_count(10)
sequence = plasmafx.Sequence(NUM_LIGHTS)
for x in range(NUM_LIGHTS):
sequence.set_plugin(x, plugins.FXCycle(
speed=2,
spread=5,
offset=(360.0/NUM_LIGHTS) * x
))
sequence.set_plugin(0, plugins.Pulse([
(0, 0, 0),
(255, 0, 255)
]))
sequence.set_plugin(1, plugins.Pulse([
(255, 0, 0),
(0, 0, 255),
(0, 0, 0)
], speed=0.5))
while True:
values = sequence.get_leds()
for index, rgb in enumerate(values):
# print("Setting pixel: {} to {}:{}:{}".format(index, *rgb))
plasma.set_pixel(index, *rgb)
plasma.show()
time.sleep(1.0 / FPS)
| [
11748,
16074,
198,
11748,
458,
8597,
1878,
87,
198,
6738,
458,
8597,
1878,
87,
1330,
20652,
198,
11748,
640,
198,
198,
37,
3705,
796,
3126,
198,
41359,
62,
43,
34874,
796,
838,
198,
198,
489,
11797,
13,
2617,
62,
2971,
62,
9127,
7,
940,
8,
198,
198,
43167,
796,
458,
8597,
1878,
87,
13,
44015,
594,
7,
41359,
62,
43,
34874,
8,
198,
198,
1640,
2124,
287,
2837,
7,
41359,
62,
43,
34874,
2599,
198,
220,
220,
220,
8379,
13,
2617,
62,
33803,
7,
87,
11,
20652,
13,
17213,
20418,
2375,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2866,
28,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4104,
28,
20,
11,
198,
220,
220,
220,
220,
220,
220,
220,
11677,
16193,
15277,
13,
15,
14,
41359,
62,
43,
34874,
8,
1635,
2124,
198,
220,
220,
220,
15306,
198,
198,
43167,
13,
2617,
62,
33803,
7,
15,
11,
20652,
13,
47,
9615,
26933,
198,
197,
7,
15,
11,
657,
11,
657,
828,
198,
197,
7,
13381,
11,
657,
11,
14280,
8,
198,
60,
4008,
198,
198,
43167,
13,
2617,
62,
33803,
7,
16,
11,
20652,
13,
47,
9615,
26933,
198,
220,
220,
220,
220,
220,
220,
220,
357,
13381,
11,
657,
11,
657,
828,
198,
220,
220,
220,
220,
220,
220,
220,
357,
15,
11,
657,
11,
14280,
828,
198,
220,
220,
220,
220,
220,
220,
220,
357,
15,
11,
657,
11,
657,
8,
198,
4357,
2866,
28,
15,
13,
20,
4008,
198,
198,
4514,
6407,
25,
198,
220,
220,
220,
3815,
796,
8379,
13,
1136,
62,
992,
82,
3419,
628,
220,
220,
220,
329,
6376,
11,
46140,
287,
27056,
378,
7,
27160,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3601,
7203,
34149,
17465,
25,
23884,
284,
23884,
29164,
92,
29164,
92,
1911,
18982,
7,
9630,
11,
1635,
81,
22296,
4008,
198,
220,
220,
220,
220,
220,
220,
220,
16074,
13,
2617,
62,
32515,
7,
9630,
11,
1635,
81,
22296,
8,
198,
220,
220,
220,
16074,
13,
12860,
3419,
198,
220,
220,
220,
640,
13,
42832,
7,
16,
13,
15,
1220,
22082,
8,
198
] | 2.122507 | 351 |
# Copyright 2020 Akamai Technologies, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Conversions from strings returned by Athena to Python types.
"""
from __future__ import annotations
import datetime as dt
import json
from abc import ABCMeta, abstractmethod
from decimal import Decimal
from typing import Dict, Generic, Iterable, List, Optional, Sequence, TypeVar
from pallas._compat import numpy as np
from pallas._compat import pandas as pd
T_co = TypeVar("T_co", covariant=True)
class Converter(Generic[T_co], metaclass=ABCMeta):
"""
Convert values returned by Athena to Python types.
"""
@property
@abstractmethod
def dtype(self) -> object:
"""Pandas dtype"""
def read(self, value: Optional[str]) -> Optional[T_co]:
"""
Read value returned from Athena.
Expect a string or ``None`` because optional strings
are what Athena returns at its API and that is also
what can be parsed from CSV stored in S3.
"""
if value is None:
return None
return self.read_str(value)
@abstractmethod
def read_str(self, value: str) -> T_co:
"""
Read value from string
To be implemented in subclasses.
"""
def read_array(
self, values: Iterable[Optional[str]], dtype: Optional[object] = None,
) -> object: # Pandas array
"""
Convert values returned from Athena to Pandas array.
:param values: Iterable yielding strings and ``None``
:param dtype: optional Pandas dtype to force
"""
if dtype is None:
dtype = self.dtype
converted = [self.read(value) for value in values]
return _pd_array(converted, dtype=dtype)
class ArrayConverter(Converter[List[str]]):
"""
Parse string returned by Athena to a list.
Array parsing has multiple limitations because of the
serialization format that Athena uses:
- Always returns a list of strings because Athena does
not send more details about item types.
- It is not possible to distinguish comma in values from
an item separator. We assume that values do not contain the comma.
- We are not able to distinguish an empty array
and an array with one empty string.
This converter returns an empty array in that case.
"""
@property
class MapConverter(Converter[Dict[str, str]]):
"""
Convert string value returned from Athena to a dictionary.
Map parsing has multiple limitations because of the
serialization format that Athena uses:
- Always returns a mapping from strings to strings because
Athena does not send more details about item types.
- It is not possible to distinguish a comma or an equal sign
in values from control characters.
We assume that values do not contain the comma or the equal sign.
"""
@property
default_converter = TextConverter()
CONVERTERS: Dict[str, Converter[object]] = {
"boolean": BooleanConverter(),
"tinyint": IntConverter(8),
"smallint": IntConverter(16),
"integer": IntConverter(32),
"bigint": IntConverter(64),
"float": FloatConverter(32),
"double": FloatConverter(64),
"decimal": DecimalConverter(),
"date": DateConverter(),
"timestamp": DateTimeConverter(),
"varbinary": BinaryConverter(),
"array": ArrayConverter(),
"map": MapConverter(),
"json": JSONConverter(),
}
def get_converter(column_type: str) -> Converter[object]:
"""
Return a converter for a column type.
:param column_type: a column type as reported by Athena
:return: a converter instance.
"""
return CONVERTERS.get(column_type, default_converter)
| [
2,
15069,
12131,
9084,
1689,
72,
21852,
11,
3457,
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,
198,
3103,
47178,
422,
13042,
4504,
416,
21341,
284,
11361,
3858,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
4818,
8079,
355,
288,
83,
198,
11748,
33918,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
6738,
32465,
1330,
4280,
4402,
198,
6738,
19720,
1330,
360,
713,
11,
42044,
11,
40806,
540,
11,
7343,
11,
32233,
11,
45835,
11,
5994,
19852,
198,
198,
6738,
279,
7826,
13557,
5589,
265,
1330,
299,
32152,
355,
45941,
198,
6738,
279,
7826,
13557,
5589,
265,
1330,
19798,
292,
355,
279,
67,
198,
198,
51,
62,
1073,
796,
5994,
19852,
7203,
51,
62,
1073,
1600,
44829,
415,
28,
17821,
8,
628,
198,
198,
4871,
35602,
353,
7,
46189,
58,
51,
62,
1073,
4357,
1138,
330,
31172,
28,
24694,
48526,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
38240,
3815,
4504,
416,
21341,
284,
11361,
3858,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
26745,
198,
220,
220,
220,
2488,
397,
8709,
24396,
198,
220,
220,
220,
825,
288,
4906,
7,
944,
8,
4613,
2134,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
47206,
292,
288,
4906,
37811,
628,
220,
220,
220,
825,
1100,
7,
944,
11,
1988,
25,
32233,
58,
2536,
12962,
4613,
32233,
58,
51,
62,
1073,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4149,
1988,
4504,
422,
21341,
13,
628,
220,
220,
220,
220,
220,
220,
220,
23600,
257,
4731,
393,
7559,
14202,
15506,
780,
11902,
13042,
198,
220,
220,
220,
220,
220,
220,
220,
389,
644,
21341,
5860,
379,
663,
7824,
290,
326,
318,
635,
198,
220,
220,
220,
220,
220,
220,
220,
644,
460,
307,
44267,
422,
44189,
8574,
287,
311,
18,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
1988,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
6045,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
2116,
13,
961,
62,
2536,
7,
8367,
8,
628,
220,
220,
220,
2488,
397,
8709,
24396,
198,
220,
220,
220,
825,
1100,
62,
2536,
7,
944,
11,
1988,
25,
965,
8,
4613,
309,
62,
1073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
4149,
1988,
422,
4731,
628,
220,
220,
220,
220,
220,
220,
220,
1675,
307,
9177,
287,
850,
37724,
13,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
628,
220,
220,
220,
825,
1100,
62,
18747,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
11,
3815,
25,
40806,
540,
58,
30719,
58,
2536,
60,
4357,
288,
4906,
25,
32233,
58,
15252,
60,
796,
6045,
11,
198,
220,
220,
220,
1267,
4613,
2134,
25,
220,
1303,
16492,
292,
7177,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
38240,
3815,
4504,
422,
21341,
284,
16492,
292,
7177,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
3815,
25,
40806,
540,
39127,
13042,
290,
7559,
14202,
15506,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
288,
4906,
25,
11902,
16492,
292,
288,
4906,
284,
2700,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
198,
220,
220,
220,
220,
220,
220,
220,
611,
288,
4906,
318,
6045,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
288,
4906,
796,
2116,
13,
67,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
11513,
796,
685,
944,
13,
961,
7,
8367,
8,
329,
1988,
287,
3815,
60,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
4808,
30094,
62,
18747,
7,
1102,
13658,
11,
288,
4906,
28,
67,
4906,
8,
628,
628,
628,
628,
628,
198,
4871,
15690,
3103,
332,
353,
7,
3103,
332,
353,
58,
8053,
58,
2536,
11907,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2547,
325,
4731,
4504,
416,
21341,
284,
257,
1351,
13,
628,
220,
220,
220,
15690,
32096,
468,
3294,
11247,
780,
286,
262,
198,
220,
220,
220,
11389,
1634,
5794,
326,
21341,
3544,
25,
628,
220,
220,
220,
220,
532,
16622,
5860,
257,
1351,
286,
13042,
780,
21341,
857,
198,
220,
220,
220,
220,
220,
220,
407,
3758,
517,
3307,
546,
2378,
3858,
13,
198,
220,
220,
220,
220,
532,
632,
318,
407,
1744,
284,
15714,
39650,
287,
3815,
422,
198,
220,
220,
220,
220,
220,
220,
281,
2378,
2880,
1352,
13,
775,
7048,
326,
3815,
466,
407,
3994,
262,
39650,
13,
198,
220,
220,
220,
220,
532,
775,
389,
407,
1498,
284,
15714,
281,
6565,
7177,
198,
220,
220,
220,
220,
220,
220,
290,
281,
7177,
351,
530,
6565,
4731,
13,
198,
220,
220,
220,
220,
220,
220,
770,
38394,
5860,
281,
6565,
7177,
287,
326,
1339,
13,
628,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
26745,
628,
198,
4871,
9347,
3103,
332,
353,
7,
3103,
332,
353,
58,
35,
713,
58,
2536,
11,
965,
11907,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
38240,
4731,
1988,
4504,
422,
21341,
284,
257,
22155,
13,
628,
220,
220,
220,
9347,
32096,
468,
3294,
11247,
780,
286,
262,
198,
220,
220,
220,
11389,
1634,
5794,
326,
21341,
3544,
25,
628,
220,
220,
220,
532,
16622,
5860,
257,
16855,
422,
13042,
284,
13042,
780,
198,
220,
220,
220,
220,
220,
21341,
857,
407,
3758,
517,
3307,
546,
2378,
3858,
13,
198,
220,
220,
220,
532,
632,
318,
407,
1744,
284,
15714,
257,
39650,
393,
281,
4961,
1051,
198,
220,
220,
220,
220,
220,
287,
3815,
422,
1630,
3435,
13,
198,
220,
220,
220,
220,
220,
775,
7048,
326,
3815,
466,
407,
3994,
262,
39650,
393,
262,
4961,
1051,
13,
198,
220,
220,
220,
37227,
628,
220,
220,
220,
2488,
26745,
628,
198,
198,
12286,
62,
1102,
332,
353,
796,
8255,
3103,
332,
353,
3419,
198,
198,
10943,
15858,
4877,
25,
360,
713,
58,
2536,
11,
35602,
353,
58,
15252,
11907,
796,
1391,
198,
220,
220,
220,
366,
2127,
21052,
1298,
41146,
3103,
332,
353,
22784,
198,
220,
220,
220,
366,
44152,
600,
1298,
2558,
3103,
332,
353,
7,
23,
828,
198,
220,
220,
220,
366,
17470,
600,
1298,
2558,
3103,
332,
353,
7,
1433,
828,
198,
220,
220,
220,
366,
41433,
1298,
2558,
3103,
332,
353,
7,
2624,
828,
198,
220,
220,
220,
366,
14261,
600,
1298,
2558,
3103,
332,
353,
7,
2414,
828,
198,
220,
220,
220,
366,
22468,
1298,
48436,
3103,
332,
353,
7,
2624,
828,
198,
220,
220,
220,
366,
23352,
1298,
48436,
3103,
332,
353,
7,
2414,
828,
198,
220,
220,
220,
366,
12501,
4402,
1298,
4280,
4402,
3103,
332,
353,
22784,
198,
220,
220,
220,
366,
4475,
1298,
7536,
3103,
332,
353,
22784,
198,
220,
220,
220,
366,
16514,
27823,
1298,
7536,
7575,
3103,
332,
353,
22784,
198,
220,
220,
220,
366,
7785,
39491,
1298,
45755,
3103,
332,
353,
22784,
198,
220,
220,
220,
366,
18747,
1298,
15690,
3103,
332,
353,
22784,
198,
220,
220,
220,
366,
8899,
1298,
9347,
3103,
332,
353,
22784,
198,
220,
220,
220,
366,
17752,
1298,
19449,
3103,
332,
353,
22784,
198,
92,
628,
198,
4299,
651,
62,
1102,
332,
353,
7,
28665,
62,
4906,
25,
965,
8,
4613,
35602,
353,
58,
15252,
5974,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8229,
257,
38394,
329,
257,
5721,
2099,
13,
628,
220,
220,
220,
1058,
17143,
5721,
62,
4906,
25,
257,
5721,
2099,
355,
2098,
416,
21341,
198,
220,
220,
220,
1058,
7783,
25,
257,
38394,
4554,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1441,
7102,
15858,
4877,
13,
1136,
7,
28665,
62,
4906,
11,
4277,
62,
1102,
332,
353,
8,
198
] | 2.950729 | 1,441 |
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
| [
2220,
7203,
31,
65,
41319,
62,
31391,
1003,
31391,
14,
11249,
62,
4299,
82,
14,
260,
7501,
25,
26791,
13,
65,
48274,
1600,
366,
25991,
4943,
198,
2220,
7203,
31,
65,
41319,
62,
31391,
1003,
31391,
14,
11249,
62,
4299,
82,
14,
260,
7501,
25,
4023,
13,
65,
48274,
1600,
366,
4023,
62,
17474,
4943,
198
] | 2.357143 | 56 |
url = r"onlinelibrary.wiley.com/journal/{ID}/(?P<ISSN>\(ISSN\)[\d-]*)"
extractor_args = dict(restrict_text=[r"author\s*guidelines"])
template = (
"https://onlinelibrary.wiley.com/page/journal/{ID}/{ISSN}/homepage/forauthors.html"
)
| [
6371,
796,
374,
1,
261,
2815,
417,
4115,
13,
86,
9618,
13,
785,
14,
24891,
14,
90,
2389,
92,
29006,
30,
47,
27,
1797,
15571,
29,
59,
7,
1797,
15571,
22725,
58,
59,
67,
12,
60,
9,
16725,
198,
2302,
40450,
62,
22046,
796,
8633,
7,
2118,
2012,
62,
5239,
41888,
81,
1,
9800,
59,
82,
9,
5162,
7984,
8973,
8,
198,
28243,
796,
357,
198,
220,
220,
220,
366,
5450,
1378,
261,
2815,
417,
4115,
13,
86,
9618,
13,
785,
14,
7700,
14,
24891,
14,
90,
2389,
92,
14,
90,
1797,
15571,
92,
14,
11195,
7700,
14,
1640,
41617,
13,
6494,
1,
198,
8,
198
] | 2.226415 | 106 |
import json
from flask import Flask, request, jsonify, make_response
from flask_restful import Api, Resource, reqparse
from simplexml import dumps
from estimator import estimator
app = Flask(__name__)
api = Api(app, default_mediatype=None)
@api.representation('application/json')
def output_xml(data, code, headers=None):
"""Make a Flask response with a XML encoded body"""
resp = make_response(dumps({'response': data}), code)
resp.headers.extend(headers or {})
return resp
@app.after_request
api.add_resource(Covid19EstimatorApi, '/api/v1/on-covid-19')
api.add_resource(Covid19EstimatorApi, '/api/v1/on-covid-19/json',
resource_class_kwargs={'representations': {'application/json': output_json}},
endpoint='covid19_estimator_api_json'
)
api.add_resource(Covid19EstimatorApi, '/api/v1/on-covid-19/xml',
resource_class_kwargs={'representations': {'application/xml': output_xml}},
endpoint='covid19_estimator_api_xml'
)
app.run(debug=True)
| [
11748,
33918,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
33918,
1958,
11,
787,
62,
26209,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
11,
20857,
11,
43089,
29572,
198,
6738,
2829,
19875,
1330,
45514,
198,
6738,
3959,
1352,
1330,
3959,
1352,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
15042,
796,
5949,
72,
7,
1324,
11,
4277,
62,
2379,
265,
2981,
28,
14202,
8,
198,
198,
31,
15042,
13,
15603,
341,
10786,
31438,
14,
17752,
11537,
198,
198,
4299,
5072,
62,
19875,
7,
7890,
11,
2438,
11,
24697,
28,
14202,
2599,
198,
220,
220,
220,
37227,
12050,
257,
46947,
2882,
351,
257,
23735,
30240,
1767,
37811,
198,
220,
220,
220,
1217,
796,
787,
62,
26209,
7,
67,
8142,
15090,
6,
26209,
10354,
1366,
92,
828,
2438,
8,
198,
220,
220,
220,
1217,
13,
50145,
13,
2302,
437,
7,
50145,
393,
23884,
8,
628,
220,
220,
220,
1441,
1217,
198,
198,
31,
1324,
13,
8499,
62,
25927,
198,
198,
15042,
13,
2860,
62,
31092,
7,
34,
709,
312,
1129,
22362,
320,
1352,
32,
14415,
11,
31051,
15042,
14,
85,
16,
14,
261,
12,
66,
709,
312,
12,
1129,
11537,
198,
15042,
13,
2860,
62,
31092,
7,
34,
709,
312,
1129,
22362,
320,
1352,
32,
14415,
11,
31051,
15042,
14,
85,
16,
14,
261,
12,
66,
709,
312,
12,
1129,
14,
17752,
3256,
220,
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,
8271,
62,
4871,
62,
46265,
22046,
34758,
6,
15603,
602,
10354,
1391,
6,
31438,
14,
17752,
10354,
5072,
62,
17752,
92,
5512,
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,
36123,
11639,
66,
709,
312,
1129,
62,
395,
320,
1352,
62,
15042,
62,
17752,
6,
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,
1267,
198,
15042,
13,
2860,
62,
31092,
7,
34,
709,
312,
1129,
22362,
320,
1352,
32,
14415,
11,
31051,
15042,
14,
85,
16,
14,
261,
12,
66,
709,
312,
12,
1129,
14,
19875,
3256,
220,
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,
8271,
62,
4871,
62,
46265,
22046,
34758,
6,
15603,
602,
10354,
1391,
6,
31438,
14,
19875,
10354,
5072,
62,
19875,
92,
5512,
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,
36123,
11639,
66,
709,
312,
1129,
62,
395,
320,
1352,
62,
15042,
62,
19875,
6,
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,
1267,
198,
198,
1324,
13,
5143,
7,
24442,
28,
17821,
8,
198
] | 2.157895 | 532 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
from .layers import PixelShuffle_ICNR
| [
201,
198,
11748,
28034,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
201,
198,
11748,
25064,
201,
198,
6738,
764,
75,
6962,
1330,
11349,
2484,
18137,
62,
2149,
24723,
220,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | 2.421053 | 57 |
import os
import pandas as pd
df = pd.read_csv(
"{}/practice-pandas/data/test-participant.csv".format(os.getcwd()), sep=',', engine='python', verbose=True)
df_grouped = df.groupby("GENRE_CODE").count()
df_sorted = df_grouped["ID"].sort_values(ascending=False)
# Top 1000.
print(df_sorted.head(1000))
"""
GENRE_CODE
Blue 14
Green 10
Yellow 8
Red 8
White 4
Orange 3
Black 3
Violet 2
Pink 2
Gray 2
YellowGreen 1
SkyBlue 1
Purple 1
Brown 1
Name: ID, dtype: int64
"""
print("Info : Finished.")
| [
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
7,
198,
220,
220,
220,
45144,
92,
14,
39541,
12,
79,
392,
292,
14,
7890,
14,
9288,
12,
48013,
415,
13,
40664,
1911,
18982,
7,
418,
13,
1136,
66,
16993,
3419,
828,
41767,
28,
3256,
3256,
3113,
11639,
29412,
3256,
15942,
577,
28,
17821,
8,
198,
198,
7568,
62,
8094,
276,
796,
47764,
13,
8094,
1525,
7203,
35353,
2200,
62,
34,
16820,
11074,
9127,
3419,
198,
7568,
62,
82,
9741,
796,
47764,
62,
8094,
276,
14692,
2389,
1,
4083,
30619,
62,
27160,
7,
3372,
1571,
28,
25101,
8,
198,
198,
2,
5849,
8576,
13,
198,
4798,
7,
7568,
62,
82,
9741,
13,
2256,
7,
12825,
4008,
198,
198,
37811,
198,
35353,
2200,
62,
34,
16820,
198,
14573,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1478,
198,
13719,
220,
220,
220,
220,
220,
220,
220,
220,
220,
838,
198,
39499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
807,
198,
7738,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
807,
198,
12256,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
604,
198,
40141,
220,
220,
220,
220,
220,
220,
220,
220,
220,
513,
198,
9915,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
513,
198,
53,
19194,
220,
220,
220,
220,
220,
220,
220,
220,
220,
362,
198,
41912,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
362,
198,
46130,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
362,
198,
39499,
13719,
220,
220,
220,
220,
352,
198,
22308,
14573,
220,
220,
220,
220,
220,
220,
220,
220,
352,
198,
30026,
1154,
220,
220,
220,
220,
220,
220,
220,
220,
220,
352,
198,
20644,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
352,
198,
5376,
25,
4522,
11,
288,
4906,
25,
493,
2414,
198,
37811,
198,
198,
4798,
7203,
12360,
220,
220,
220,
1058,
42931,
19570,
198
] | 1.886567 | 335 |
from vietocr.tool.translate import build_model, translate, translate_beam_search, process_input, predict
from vietocr.tool.utils import download_weights
from vietocr.tool.config import Cfg
import sys
import os
import cv2
import numpy as np
import math
import pandas as pd
import torch
import time
from cropper import Cropper
from detector import Detector
from format_info import format_information
###multi threading
#from threading import Thread
if __name__ == "__main__":
cropper = Cropper()
detector = Detector()
reader = Reader()
type_img = ['jpg', 'png']
image_folder = 'test_images/'
images = os.listdir(image_folder)
for image_file in images:
if image_file[-3:] in type_img:
start = time.time()
path = image_folder + image_file
image = cv2.imread(path)
H, W = image.shape[:2]
image_resized = cv2.resize(image, (416, int(416 * H/W)))
cv2.imshow("raw_image", image_resized)
dictInformationText = dict()
dictInformationImage = dict()
return_code, aligned_image = cropper.crop_and_align_image(image)
#print('cropper: ', time.time() - start)
tmp = 0
if return_code == 0:
for c in detector.classes:
dictInformationText[c] = 'N/A'
print (dictInformationText)
elif return_code == 2:
tmp = 1
index = 0
aligned_image = image
while(index < 4):
dictInformationImage = detector.detect_information(aligned_image)
keys = dictInformationImage.keys()
if 'id' in keys and 'ho_ten' in keys and 'ngay_sinh' in keys:
tmp = 2
break
else:
aligned_image = cv2.rotate(aligned_image, cv2.cv2.ROTATE_90_CLOCKWISE)
index+=1
if tmp == 0:
dictInformationImage = detector.detect_information(aligned_image)
if tmp == 1:
for c in detector.classes:
dictInformationText[c] = 'N/A'
print(dictInformationText)
#print('detector: ', time.time() - start)
for key in dictInformationImage.keys():
dictInformationText[key] = reader.read_information(dictInformationImage[key])
#cv2.imwrite('images_uploaded/' + dictInformationText['id'] + '.jpg', image)
output_dict = format_information(dictInformationText)
print('Time processing: ', time.time() - start)
for key in output_dict.keys():
info = key + ': ' + output_dict[key]
print(info)
#print(output_dict)
cv2.waitKey()
cv2.destroyAllWindows() | [
6738,
410,
1155,
1696,
13,
25981,
13,
7645,
17660,
1330,
1382,
62,
19849,
11,
15772,
11,
15772,
62,
40045,
62,
12947,
11,
1429,
62,
15414,
11,
4331,
198,
6738,
410,
1155,
1696,
13,
25981,
13,
26791,
1330,
4321,
62,
43775,
198,
6738,
410,
1155,
1696,
13,
25981,
13,
11250,
1330,
327,
40616,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
198,
11748,
640,
198,
6738,
6763,
2848,
1330,
9325,
2848,
198,
6738,
31029,
1330,
4614,
9250,
198,
6738,
5794,
62,
10951,
1330,
5794,
62,
17018,
198,
21017,
41684,
4704,
278,
198,
2,
6738,
4704,
278,
1330,
14122,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
6763,
2848,
796,
9325,
2848,
3419,
198,
220,
220,
220,
31029,
796,
4614,
9250,
3419,
198,
220,
220,
220,
9173,
796,
25342,
3419,
198,
220,
220,
220,
2099,
62,
9600,
796,
37250,
9479,
3256,
705,
11134,
20520,
198,
220,
220,
220,
2939,
62,
43551,
796,
705,
9288,
62,
17566,
14,
6,
198,
220,
220,
220,
4263,
796,
28686,
13,
4868,
15908,
7,
9060,
62,
43551,
8,
198,
220,
220,
220,
329,
2939,
62,
7753,
287,
4263,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
2939,
62,
7753,
58,
12,
18,
47715,
287,
2099,
62,
9600,
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,
3108,
796,
2939,
62,
43551,
1343,
2939,
62,
7753,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
796,
269,
85,
17,
13,
320,
961,
7,
6978,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
367,
11,
370,
796,
2939,
13,
43358,
58,
25,
17,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2939,
62,
411,
1143,
796,
269,
85,
17,
13,
411,
1096,
7,
9060,
11,
357,
35218,
11,
493,
7,
35218,
1635,
367,
14,
54,
22305,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
320,
12860,
7203,
1831,
62,
9060,
1600,
2939,
62,
411,
1143,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
21918,
8206,
796,
8633,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
21918,
5159,
796,
8633,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1441,
62,
8189,
11,
19874,
62,
9060,
796,
6763,
2848,
13,
31476,
62,
392,
62,
31494,
62,
9060,
7,
9060,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
10786,
19915,
2848,
25,
46083,
640,
13,
2435,
3419,
532,
923,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45218,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
1441,
62,
8189,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
269,
287,
31029,
13,
37724,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
21918,
8206,
58,
66,
60,
796,
705,
45,
14,
32,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
357,
11600,
21918,
8206,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
1441,
62,
8189,
6624,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45218,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6376,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19874,
62,
9060,
796,
2939,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
981,
7,
9630,
1279,
604,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
21918,
5159,
796,
31029,
13,
15255,
478,
62,
17018,
7,
41634,
62,
9060,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8251,
796,
8633,
21918,
5159,
13,
13083,
3419,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
705,
312,
6,
287,
8251,
290,
705,
8873,
62,
1452,
6,
287,
8251,
290,
705,
782,
323,
62,
31369,
71,
6,
287,
8251,
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,
45218,
796,
362,
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,
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,
19874,
62,
9060,
796,
269,
85,
17,
13,
10599,
378,
7,
41634,
62,
9060,
11,
269,
85,
17,
13,
33967,
17,
13,
49,
2394,
6158,
62,
3829,
62,
5097,
11290,
54,
24352,
8,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6376,
47932,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
45218,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
21918,
5159,
796,
31029,
13,
15255,
478,
62,
17018,
7,
41634,
62,
9060,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
45218,
6624,
352,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
269,
287,
31029,
13,
37724,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
21918,
8206,
58,
66,
60,
796,
705,
45,
14,
32,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
11600,
21918,
8206,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
10786,
15255,
9250,
25,
46083,
640,
13,
2435,
3419,
532,
923,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
287,
8633,
21918,
5159,
13,
13083,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8633,
21918,
8206,
58,
2539,
60,
796,
9173,
13,
961,
62,
17018,
7,
11600,
21918,
5159,
58,
2539,
12962,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
33967,
17,
13,
320,
13564,
10786,
17566,
62,
25850,
276,
14,
6,
1343,
8633,
21918,
8206,
17816,
312,
20520,
1343,
45302,
9479,
3256,
2939,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5072,
62,
11600,
796,
5794,
62,
17018,
7,
11600,
21918,
8206,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
10786,
7575,
7587,
25,
46083,
640,
13,
2435,
3419,
532,
923,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1994,
287,
5072,
62,
11600,
13,
13083,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7508,
796,
1994,
1343,
705,
25,
705,
1343,
5072,
62,
11600,
58,
2539,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
10951,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
7,
22915,
62,
11600,
8,
198,
220,
220,
220,
220,
220,
220,
220,
269,
85,
17,
13,
17077,
9218,
3419,
198,
220,
220,
220,
269,
85,
17,
13,
41659,
3237,
11209,
3419
] | 2.052817 | 1,420 |
a= 30
a //= 2
print(a)
| [
64,
28,
1542,
201,
198,
64,
3373,
28,
362,
201,
198,
4798,
7,
64,
8,
201,
198
] | 1.529412 | 17 |
##script used to combine multiple files into a matrix
import os, sys
import pandas as pd
import numpy as np
sum_matrix = open(sys.argv[1]+"_binary.matrix.txt","w")
# open with pandas
df = pd.read_csv(sys.argv[1], sep='\t', index_col = 0)
#get first line as title list
col_list= list(df.columns.values)
print (col_list)
#title_list = start_inp.readline()
#turn column to array, get each column and add their unique categorical value to make a title list
final_list = []
for i in range(0,len(col_list)):
print (i)
colname= col_list[i]
print(colname)
dfx= df.as_matrix([df.columns[i]])
dfx_un= np.unique(dfx)
for j in dfx_un:
if str(j) == 'nan':
pass
else:
string= str(df.columns[i]) + "."+str(j)
if string not in final_list:
final_list.append(string)
print (final_list)
final_str = "\t".join(str(j) for j in final_list)
sum_matrix.write("gene\t%s\n" % (final_str))
start_inp = open(sys.argv[1], "r") #categorical matrix
#loop through directory for each file to add input
D={}
add_data_to_dict(start_inp,D)
print(D)
y = len(final_list)
for gene in D:
feature_list= []
for i in range(y):
feature_list.append(0)
#feature_list= [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
#print(feature_list)
data_list= D[gene]
for data in data_list:
for xx in final_list:
ind= final_list.index(xx)
x1= xx.split(".")[0]
#print (x1)
x2= xx.split(".")[1]
#print (x2)
for x in col_list:
if x1 == x:
if x2 == data:
feature_list[ind] = 1
elif data == 'NA':
feature_list[ind] = 'NA'
#print (feature_list)
feat_str= "\t".join(str(k) for k in feature_list)
sum_matrix.write("%s\t%s\n" % (gene, feat_str))
sum_matrix.close() | [
2235,
12048,
973,
284,
12082,
3294,
3696,
656,
257,
17593,
198,
11748,
28686,
11,
25064,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
628,
198,
16345,
62,
6759,
8609,
796,
1280,
7,
17597,
13,
853,
85,
58,
16,
48688,
1,
62,
39491,
13,
6759,
8609,
13,
14116,
2430,
86,
4943,
198,
2,
1280,
351,
19798,
292,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
7,
17597,
13,
853,
85,
58,
16,
4357,
41767,
11639,
59,
83,
3256,
6376,
62,
4033,
796,
657,
8,
198,
198,
2,
1136,
717,
1627,
355,
3670,
1351,
198,
4033,
62,
4868,
28,
1351,
7,
7568,
13,
28665,
82,
13,
27160,
8,
198,
4798,
357,
4033,
62,
4868,
8,
198,
2,
7839,
62,
4868,
796,
923,
62,
259,
79,
13,
961,
1370,
3419,
198,
198,
2,
15344,
5721,
284,
7177,
11,
651,
1123,
5721,
290,
751,
511,
3748,
4253,
12409,
1988,
284,
787,
257,
3670,
1351,
198,
20311,
62,
4868,
796,
17635,
198,
1640,
1312,
287,
2837,
7,
15,
11,
11925,
7,
4033,
62,
4868,
8,
2599,
198,
220,
220,
220,
3601,
357,
72,
8,
198,
220,
220,
220,
951,
3672,
28,
951,
62,
4868,
58,
72,
60,
198,
220,
220,
220,
3601,
7,
4033,
3672,
8,
198,
220,
220,
220,
288,
21373,
28,
47764,
13,
292,
62,
6759,
8609,
26933,
7568,
13,
28665,
82,
58,
72,
11907,
8,
198,
220,
220,
220,
288,
21373,
62,
403,
28,
45941,
13,
34642,
7,
48753,
8,
198,
220,
220,
220,
329,
474,
287,
288,
21373,
62,
403,
25,
198,
220,
220,
220,
220,
220,
220,
220,
611,
965,
7,
73,
8,
6624,
705,
12647,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1208,
198,
220,
220,
220,
220,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4731,
28,
965,
7,
7568,
13,
28665,
82,
58,
72,
12962,
1343,
366,
526,
10,
2536,
7,
73,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
4731,
407,
287,
2457,
62,
4868,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2457,
62,
4868,
13,
33295,
7,
8841,
8,
198,
4798,
357,
20311,
62,
4868,
8,
198,
20311,
62,
2536,
796,
37082,
83,
1911,
22179,
7,
2536,
7,
73,
8,
329,
474,
287,
2457,
62,
4868,
8,
198,
16345,
62,
6759,
8609,
13,
13564,
7203,
70,
1734,
59,
83,
4,
82,
59,
77,
1,
4064,
357,
20311,
62,
2536,
4008,
198,
198,
9688,
62,
259,
79,
796,
1280,
7,
17597,
13,
853,
85,
58,
16,
4357,
366,
81,
4943,
1303,
66,
2397,
12409,
17593,
198,
2,
26268,
832,
8619,
329,
1123,
2393,
284,
751,
5128,
198,
35,
34758,
92,
198,
198,
2860,
62,
7890,
62,
1462,
62,
11600,
7,
9688,
62,
259,
79,
11,
35,
8,
198,
4798,
7,
35,
8,
198,
88,
796,
18896,
7,
20311,
62,
4868,
8,
198,
1640,
9779,
287,
360,
25,
198,
220,
220,
220,
3895,
62,
4868,
28,
17635,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
88,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3895,
62,
4868,
13,
33295,
7,
15,
8,
198,
220,
220,
220,
1303,
30053,
62,
4868,
28,
685,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
11,
15,
60,
198,
220,
220,
220,
1303,
4798,
7,
30053,
62,
4868,
8,
198,
220,
220,
220,
1366,
62,
4868,
28,
360,
58,
70,
1734,
60,
198,
220,
220,
220,
329,
1366,
287,
1366,
62,
4868,
25,
198,
220,
220,
220,
220,
220,
220,
220,
329,
31383,
287,
2457,
62,
4868,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
773,
28,
2457,
62,
4868,
13,
9630,
7,
5324,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
16,
28,
31383,
13,
35312,
7203,
19570,
58,
15,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
357,
87,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
17,
28,
31383,
13,
35312,
7203,
19570,
58,
16,
60,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
357,
87,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
2124,
287,
951,
62,
4868,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2124,
16,
6624,
2124,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
611,
2124,
17,
6624,
1366,
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,
3895,
62,
4868,
58,
521,
60,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1288,
361,
1366,
6624,
705,
4535,
10354,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3895,
62,
4868,
58,
521,
60,
796,
705,
4535,
6,
198,
220,
220,
220,
1303,
4798,
357,
30053,
62,
4868,
8,
198,
220,
220,
220,
2218,
62,
2536,
28,
37082,
83,
1911,
22179,
7,
2536,
7,
74,
8,
329,
479,
287,
3895,
62,
4868,
8,
198,
220,
220,
220,
2160,
62,
6759,
8609,
13,
13564,
7203,
4,
82,
59,
83,
4,
82,
59,
77,
1,
4064,
357,
70,
1734,
11,
2218,
62,
2536,
4008,
198,
198,
16345,
62,
6759,
8609,
13,
19836,
3419
] | 1.983385 | 963 |
from django.urls import path
from .views import index, TodoDetailView
from django.conf import settings
urlpatterns = [
path('', index),
path('edit/<int:pk>', TodoDetailView.as_view()),
path('delete/<int:pk>', TodoDetailView.as_view()),
]
react_routes = getattr(settings, 'REACT_ROUTES', [])
for route in react_routes:
urlpatterns += [
path('{}'.format(route), index)
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
33571,
1330,
6376,
11,
309,
24313,
11242,
603,
7680,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
6376,
828,
198,
220,
220,
220,
3108,
10786,
19312,
14,
27,
600,
25,
79,
74,
29,
3256,
309,
24313,
11242,
603,
7680,
13,
292,
62,
1177,
3419,
828,
198,
220,
220,
220,
3108,
10786,
33678,
14,
27,
600,
25,
79,
74,
29,
3256,
309,
24313,
11242,
603,
7680,
13,
292,
62,
1177,
3419,
828,
198,
60,
628,
198,
198,
45018,
62,
81,
448,
274,
796,
651,
35226,
7,
33692,
11,
705,
2200,
10659,
62,
49,
12425,
1546,
3256,
685,
12962,
198,
198,
1640,
6339,
287,
6324,
62,
81,
448,
274,
25,
198,
220,
220,
220,
19016,
33279,
82,
15853,
685,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
10786,
90,
92,
4458,
18982,
7,
38629,
828,
6376,
8,
198,
220,
220,
220,
2361,
628,
198
] | 2.39645 | 169 |
#!/usr/bin/python
#
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# All rights reserved.
#
# The Astrobee platform is 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.
"""
Generates a groundtruth map for a given input bagfile. The groundtruth map
creation process merges images from the input bagfile with an existing map.
This is the first step for groundtruth creation, where once a groundtruth map
is created for a bagfile the bagfile can then be localized using the groundtruth
map to generate groundtruth poses.
"""
import argparse
import os
import shutil
import sys
import utilities
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument("bagfile", help="Input bagfile to generate groundtruth for.")
parser.add_argument(
"base_surf_map",
help="Existing map to use as basis for groundtruth. Should largely overlap area covered in input bagfile.",
)
parser.add_argument(
"maps_directory",
help="Location of images used for each bagfile use to generate base_surf_map.",
)
parser.add_argument(
"-o", "--output-directory", default="groundtruth_creation_output"
)
parser.add_argument("-w", "--world", default="iss")
parser.add_argument("-r", "--robot-name", default="bumble")
parser.add_argument("-m", "--map-name", default="groundtruth")
args = parser.parse_args()
if not os.path.isfile(args.bagfile):
print("Bag file " + args.bagfile + " does not exist.")
sys.exit()
if not os.path.isfile(args.base_surf_map):
print("Base surf map " + args.base_surf_map + " does not exist.")
sys.exit()
if not os.path.isdir(args.maps_directory):
print("Maps directory " + args.maps_directory + " does not exist.")
sys.exit()
if os.path.isdir(args.output_directory):
print("Output directory " + args.output_directory + " already exists.")
sys.exit()
bagfile = os.path.abspath(args.bagfile)
base_surf_map = os.path.abspath(args.base_surf_map)
maps_directory = os.path.abspath(args.maps_directory)
os.mkdir(args.output_directory)
os.chdir(args.output_directory)
create_groundtruth(
bagfile,
base_surf_map,
maps_directory,
args.map_name,
args.world,
args.robot_name,
)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
357,
66,
8,
2177,
11,
1578,
1829,
5070,
11,
355,
7997,
416,
262,
198,
2,
22998,
286,
262,
2351,
15781,
261,
2306,
873,
290,
4687,
8694,
13,
198,
2,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
383,
35167,
20963,
3859,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
198,
2,
357,
1169,
366,
34156,
15341,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
198,
2,
13789,
13,
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,
42881,
198,
2,
34764,
11015,
6375,
7102,
49828,
11053,
3963,
15529,
509,
12115,
11,
2035,
4911,
393,
17142,
13,
4091,
262,
198,
2,
13789,
329,
262,
2176,
3303,
15030,
21627,
290,
11247,
198,
2,
739,
262,
13789,
13,
198,
37811,
198,
8645,
689,
257,
2323,
35310,
3975,
329,
257,
1813,
5128,
6131,
7753,
13,
383,
2323,
35310,
3975,
198,
38793,
1429,
4017,
3212,
4263,
422,
262,
5128,
6131,
7753,
351,
281,
4683,
3975,
13,
220,
220,
198,
1212,
318,
262,
717,
2239,
329,
2323,
35310,
6282,
11,
810,
1752,
257,
2323,
35310,
3975,
220,
198,
271,
2727,
329,
257,
6131,
7753,
262,
6131,
7753,
460,
788,
307,
36618,
1262,
262,
2323,
35310,
198,
8899,
284,
7716,
2323,
35310,
17313,
13,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
25064,
198,
198,
11748,
20081,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
30751,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
198,
220,
220,
220,
220,
220,
220,
220,
6764,
28,
834,
15390,
834,
11,
1296,
1436,
62,
4871,
28,
853,
29572,
13,
27369,
11828,
22087,
8479,
1436,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
21454,
7753,
1600,
1037,
2625,
20560,
6131,
7753,
284,
7716,
2323,
35310,
329,
19570,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
366,
8692,
62,
11793,
69,
62,
8899,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
3109,
9665,
3975,
284,
779,
355,
4308,
329,
2323,
35310,
13,
220,
10358,
5688,
21721,
1989,
5017,
287,
5128,
6131,
7753,
33283,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
366,
31803,
62,
34945,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
1037,
2625,
14749,
286,
4263,
973,
329,
1123,
6131,
7753,
779,
284,
7716,
2779,
62,
11793,
69,
62,
8899,
33283,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7,
198,
220,
220,
220,
220,
220,
220,
220,
27444,
78,
1600,
366,
438,
22915,
12,
34945,
1600,
4277,
2625,
2833,
35310,
62,
38793,
62,
22915,
1,
198,
220,
220,
220,
1267,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
86,
1600,
366,
438,
6894,
1600,
4277,
2625,
747,
4943,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
81,
1600,
366,
438,
305,
13645,
12,
3672,
1600,
4277,
2625,
4435,
903,
4943,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
7203,
12,
76,
1600,
366,
438,
8899,
12,
3672,
1600,
4277,
2625,
2833,
35310,
4943,
628,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
198,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
4468,
576,
7,
22046,
13,
21454,
7753,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
33,
363,
2393,
366,
1343,
26498,
13,
21454,
7753,
1343,
366,
857,
407,
2152,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
3419,
198,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
4468,
576,
7,
22046,
13,
8692,
62,
11793,
69,
62,
8899,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
14881,
9053,
3975,
366,
1343,
26498,
13,
8692,
62,
11793,
69,
62,
8899,
1343,
366,
857,
407,
2152,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
3419,
198,
220,
220,
220,
611,
407,
28686,
13,
6978,
13,
9409,
343,
7,
22046,
13,
31803,
62,
34945,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
47010,
8619,
366,
1343,
26498,
13,
31803,
62,
34945,
1343,
366,
857,
407,
2152,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
3419,
198,
220,
220,
220,
611,
28686,
13,
6978,
13,
9409,
343,
7,
22046,
13,
22915,
62,
34945,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
26410,
8619,
366,
1343,
26498,
13,
22915,
62,
34945,
1343,
366,
1541,
7160,
19570,
198,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
37023,
3419,
628,
220,
220,
220,
6131,
7753,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
22046,
13,
21454,
7753,
8,
198,
220,
220,
220,
2779,
62,
11793,
69,
62,
8899,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
22046,
13,
8692,
62,
11793,
69,
62,
8899,
8,
198,
220,
220,
220,
8739,
62,
34945,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
22046,
13,
31803,
62,
34945,
8,
628,
220,
220,
220,
28686,
13,
28015,
15908,
7,
22046,
13,
22915,
62,
34945,
8,
198,
220,
220,
220,
28686,
13,
354,
15908,
7,
22046,
13,
22915,
62,
34945,
8,
628,
220,
220,
220,
2251,
62,
2833,
35310,
7,
198,
220,
220,
220,
220,
220,
220,
220,
6131,
7753,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2779,
62,
11793,
69,
62,
8899,
11,
198,
220,
220,
220,
220,
220,
220,
220,
8739,
62,
34945,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
8899,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
6894,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26498,
13,
305,
13645,
62,
3672,
11,
198,
220,
220,
220,
1267,
198
] | 2.885906 | 1,043 |
from datetime import timedelta
from flask import request, current_app
from flask_jwt_extended import jwt_required, create_access_token, get_jwt_identity
from marshmallow.exceptions import ValidationError
from sqlalchemy import or_
from app.api.utils import success_response, error_response, get_items_per_page, get_request_page
from app.api.v1.main import api_v1
from app.api.models import User
from app.api.v1.user.serializer import user_schema, users_schema
from app.ext.db import db
@api_v1.route('/users', methods=['GET'])
@jwt_required
@api_v1.route('/users', methods=['POST'])
@api_v1.route('/auth/login', methods=['POST']) | [
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
6738,
42903,
1330,
2581,
11,
1459,
62,
1324,
198,
6738,
42903,
62,
73,
46569,
62,
2302,
1631,
1330,
474,
46569,
62,
35827,
11,
2251,
62,
15526,
62,
30001,
11,
651,
62,
73,
46569,
62,
738,
414,
198,
6738,
22397,
42725,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
44161,
282,
26599,
1330,
393,
62,
198,
198,
6738,
598,
13,
15042,
13,
26791,
1330,
1943,
62,
26209,
11,
4049,
62,
26209,
11,
651,
62,
23814,
62,
525,
62,
7700,
11,
651,
62,
25927,
62,
7700,
198,
6738,
598,
13,
15042,
13,
85,
16,
13,
12417,
1330,
40391,
62,
85,
16,
198,
6738,
598,
13,
15042,
13,
27530,
1330,
11787,
198,
6738,
598,
13,
15042,
13,
85,
16,
13,
7220,
13,
46911,
7509,
1330,
2836,
62,
15952,
2611,
11,
2985,
62,
15952,
2611,
198,
6738,
598,
13,
2302,
13,
9945,
1330,
20613,
198,
198,
31,
15042,
62,
85,
16,
13,
38629,
10786,
14,
18417,
3256,
5050,
28,
17816,
18851,
6,
12962,
198,
31,
73,
46569,
62,
35827,
198,
198,
31,
15042,
62,
85,
16,
13,
38629,
10786,
14,
18417,
3256,
5050,
28,
17816,
32782,
6,
12962,
628,
198,
31,
15042,
62,
85,
16,
13,
38629,
10786,
14,
18439,
14,
38235,
3256,
5050,
28,
17816,
32782,
6,
12962
] | 2.96729 | 214 |
import os
import torch
import warnings
warnings.filterwarnings('ignore')
from hpbandster.core.worker import Worker
from nes.ensemble_selection.create_baselearners import create_baselearner
| [
11748,
28686,
198,
11748,
28034,
198,
11748,
14601,
198,
40539,
654,
13,
24455,
40539,
654,
10786,
46430,
11537,
198,
198,
6738,
27673,
3903,
1706,
13,
7295,
13,
28816,
1330,
35412,
198,
6738,
299,
274,
13,
1072,
11306,
62,
49283,
13,
17953,
62,
8692,
35720,
364,
1330,
2251,
62,
8692,
3238,
1008,
628,
628
] | 3.641509 | 53 |
import tkinter
from tkinter import ttk
mainclass()
| [
11748,
256,
74,
3849,
201,
198,
6738,
256,
74,
3849,
1330,
256,
30488,
201,
198,
201,
198,
201,
198,
201,
198,
12417,
4871,
3419,
201,
198,
220,
220,
220,
220,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
201,
198
] | 1.772727 | 44 |
#!/usr/bin/env python3
from math import sqrt
# init conds
x = [15, 15, f(15, 15)]
lamb = 2
xold = [99, 99, f(99, 99)]
while dist(xold, x) > 0.5 and lamb >= 0.0001:
print("x:", x)
print("xold", xold)
xnew = grad(*x)
xnew = [x[0] - lamb * xnew[0], x[1] - lamb * xnew[1], 0]
xnew[2] = f(xnew[0], xnew[1])
print("xnew:", xnew)
if (f(x[0], x[1]) > f(xnew[0], xnew[1])):
lamb *= 2
else:
lamb /= 2
xold = x.copy()
x = xnew.copy()
print("result:", x)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
6738,
10688,
1330,
19862,
17034,
628,
628,
198,
198,
2,
2315,
1779,
82,
198,
87,
796,
685,
1314,
11,
1315,
11,
277,
7,
1314,
11,
1315,
15437,
198,
2543,
65,
796,
362,
198,
198,
87,
727,
796,
685,
2079,
11,
7388,
11,
277,
7,
2079,
11,
7388,
15437,
198,
4514,
1233,
7,
87,
727,
11,
2124,
8,
1875,
657,
13,
20,
290,
19343,
18189,
657,
13,
18005,
25,
198,
220,
220,
220,
3601,
7203,
87,
25,
1600,
2124,
8,
198,
220,
220,
220,
3601,
7203,
87,
727,
1600,
2124,
727,
8,
198,
220,
220,
220,
2124,
3605,
796,
3915,
46491,
87,
8,
198,
220,
220,
220,
2124,
3605,
796,
685,
87,
58,
15,
60,
532,
19343,
1635,
2124,
3605,
58,
15,
4357,
2124,
58,
16,
60,
532,
19343,
1635,
2124,
3605,
58,
16,
4357,
657,
60,
198,
220,
220,
220,
2124,
3605,
58,
17,
60,
796,
277,
7,
87,
3605,
58,
15,
4357,
2124,
3605,
58,
16,
12962,
198,
220,
220,
220,
3601,
7203,
87,
3605,
25,
1600,
2124,
3605,
8,
628,
220,
220,
220,
611,
357,
69,
7,
87,
58,
15,
4357,
2124,
58,
16,
12962,
1875,
277,
7,
87,
3605,
58,
15,
4357,
2124,
3605,
58,
16,
12962,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
19343,
1635,
28,
362,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
220,
220,
19343,
1220,
28,
362,
628,
220,
220,
220,
2124,
727,
796,
2124,
13,
30073,
3419,
198,
220,
220,
220,
2124,
796,
2124,
3605,
13,
30073,
3419,
198,
198,
4798,
7203,
20274,
25,
1600,
2124,
8,
198
] | 1.857664 | 274 |
# coding=utf-8
"""
Definition of models.
"""
from django.contrib.auth.models import User
from django.db import models
from django.urls import reverse
| [
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
36621,
286,
4981,
13,
198,
37811,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
628,
628,
198
] | 3.208333 | 48 |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (QSlider, QStyleOptionSlider, QStyle)
import time
| [
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
33734,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
1330,
357,
48,
11122,
1304,
11,
1195,
21466,
19722,
11122,
1304,
11,
1195,
21466,
8,
198,
11748,
640,
628
] | 2.547619 | 42 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
__all__ = [
'ConfigurationAggregatorAccountAggregationSourceArgs',
'ConfigurationAggregatorOrganizationAggregationSourceArgs',
'ConformancePackInputParameterArgs',
'DeliveryChannelSnapshotDeliveryPropertiesArgs',
'RecorderRecordingGroupArgs',
'RemediationConfigurationParameterArgs',
'RuleScopeArgs',
'RuleSourceArgs',
'RuleSourceSourceDetailArgs',
]
@pulumi.input_type
@pulumi.input_type
@pulumi.input_type
@pulumi.input_type
@pulumi.input_type
@pulumi.input_type
@pulumi.input_type
@pulumi.input_type
@pulumi.input_type
| [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
198,
198,
11748,
14601,
198,
11748,
17472,
12994,
198,
11748,
17472,
12994,
13,
43282,
198,
6738,
19720,
1330,
4377,
11,
337,
5912,
11,
32233,
11,
45835,
11,
4479,
198,
6738,
11485,
1330,
4808,
315,
2410,
11,
4808,
83,
2977,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
38149,
46384,
2301,
1352,
30116,
46384,
43068,
7416,
42035,
3256,
198,
220,
220,
220,
705,
38149,
46384,
2301,
1352,
26121,
1634,
46384,
43068,
7416,
42035,
3256,
198,
220,
220,
220,
705,
3103,
10367,
11869,
20560,
36301,
42035,
3256,
198,
220,
220,
220,
705,
33129,
29239,
43826,
9442,
33129,
2964,
18200,
42035,
3256,
198,
220,
220,
220,
705,
6690,
2875,
6690,
1284,
13247,
42035,
3256,
198,
220,
220,
220,
705,
8413,
276,
3920,
38149,
36301,
42035,
3256,
198,
220,
220,
220,
705,
31929,
43642,
42035,
3256,
198,
220,
220,
220,
705,
31929,
7416,
42035,
3256,
198,
220,
220,
220,
705,
31929,
7416,
7416,
11242,
603,
42035,
3256,
198,
60,
198,
198,
31,
79,
377,
12994,
13,
15414,
62,
4906,
628,
198,
31,
79,
377,
12994,
13,
15414,
62,
4906,
628,
198,
31,
79,
377,
12994,
13,
15414,
62,
4906,
628,
198,
31,
79,
377,
12994,
13,
15414,
62,
4906,
628,
198,
31,
79,
377,
12994,
13,
15414,
62,
4906,
628,
198,
31,
79,
377,
12994,
13,
15414,
62,
4906,
628,
198,
31,
79,
377,
12994,
13,
15414,
62,
4906,
628,
198,
31,
79,
377,
12994,
13,
15414,
62,
4906,
628,
198,
31,
79,
377,
12994,
13,
15414,
62,
4906,
628,
198
] | 3.03 | 300 |
from django import forms
from django.utils.translation import gettext_lazy as _
from rusel.base.forms import BaseCreateForm, BaseEditForm
from rusel.widgets import DateInput, Select, NumberInput, UrlsInput
from task.const import NUM_ROLE_SERVICE, APART_SERVICE
from task.models import Task
from apart.config import app_config
role = 'price'
#----------------------------------
#----------------------------------
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
7422,
741,
13,
8692,
13,
23914,
1330,
7308,
16447,
8479,
11,
7308,
18378,
8479,
198,
6738,
7422,
741,
13,
28029,
11407,
1330,
7536,
20560,
11,
9683,
11,
7913,
20560,
11,
8799,
7278,
20560,
198,
6738,
4876,
13,
9979,
1330,
36871,
62,
13252,
2538,
62,
35009,
27389,
11,
3486,
7227,
62,
35009,
27389,
198,
6738,
4876,
13,
27530,
1330,
15941,
198,
6738,
5475,
13,
11250,
1330,
598,
62,
11250,
198,
198,
18090,
796,
705,
20888,
6,
198,
198,
2,
3880,
438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
2,
3880,
438,
198
] | 3.601695 | 118 |
import sensor, time, image
# Reset sensor
sensor.reset()
# Sensor settings
sensor.set_contrast(1)
sensor.set_gainceiling(16)
sensor.set_framesize(sensor.QCIF)
sensor.set_pixformat(sensor.GRAYSCALE)
# Load Haar Cascade
# By default this will use all stages, lower satges is faster but less accurate.
face_cascade = image.HaarCascade("frontalface", stages=16)
print(face_cascade)
# FPS clock
clock = time.clock()
while (True):
clock.tick()
# Capture snapshot
img = sensor.snapshot()
# Find objects.
# Note: Lower scale factor scales-down the image more and detects smaller objects.
# Higher threshold results in a higher detection rate, with more false positives.
objects = img.find_features(face_cascade, threshold=0.65, scale=1.65)
# Draw objects
for r in objects:
img.draw_rectangle(r)
if (len(objects)):
# Add a small delay to see the drawing on the FB
time.sleep(100)
# Print FPS.
# Note: Actual FPS is higher, streaming the FB makes it slower.
print(clock.fps())
| [
11748,
12694,
11,
640,
11,
2939,
198,
198,
2,
30027,
12694,
198,
82,
22854,
13,
42503,
3419,
198,
198,
2,
35367,
6460,
198,
82,
22854,
13,
2617,
62,
3642,
5685,
7,
16,
8,
198,
82,
22854,
13,
2617,
62,
48544,
344,
4386,
7,
1433,
8,
198,
82,
22854,
13,
2617,
62,
37805,
1096,
7,
82,
22854,
13,
48,
34,
5064,
8,
198,
82,
22854,
13,
2617,
62,
79,
844,
18982,
7,
82,
22854,
13,
38,
30631,
6173,
21358,
8,
198,
198,
2,
8778,
9398,
283,
48788,
198,
2,
2750,
4277,
428,
481,
779,
477,
9539,
11,
2793,
3332,
3212,
318,
5443,
475,
1342,
7187,
13,
198,
2550,
62,
66,
28966,
796,
2939,
13,
23303,
283,
34,
28966,
7203,
8534,
1604,
558,
1600,
9539,
28,
1433,
8,
198,
4798,
7,
2550,
62,
66,
28966,
8,
198,
198,
2,
22082,
8801,
198,
15750,
796,
640,
13,
15750,
3419,
198,
198,
4514,
357,
17821,
2599,
198,
220,
220,
220,
8801,
13,
42298,
3419,
628,
220,
220,
220,
1303,
31793,
27479,
198,
220,
220,
220,
33705,
796,
12694,
13,
45380,
9442,
3419,
628,
220,
220,
220,
1303,
9938,
5563,
13,
198,
220,
220,
220,
1303,
5740,
25,
16048,
5046,
5766,
16252,
12,
2902,
262,
2939,
517,
290,
39382,
4833,
5563,
13,
198,
220,
220,
220,
1303,
16038,
11387,
2482,
287,
257,
2440,
13326,
2494,
11,
351,
517,
3991,
38548,
13,
198,
220,
220,
220,
5563,
796,
33705,
13,
19796,
62,
40890,
7,
2550,
62,
66,
28966,
11,
11387,
28,
15,
13,
2996,
11,
5046,
28,
16,
13,
2996,
8,
628,
220,
220,
220,
1303,
15315,
5563,
198,
220,
220,
220,
329,
374,
287,
5563,
25,
198,
220,
220,
220,
220,
220,
220,
220,
33705,
13,
19334,
62,
2554,
9248,
7,
81,
8,
628,
220,
220,
220,
611,
357,
11925,
7,
48205,
8,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
257,
1402,
5711,
284,
766,
262,
8263,
319,
262,
13186,
198,
220,
220,
220,
220,
220,
220,
220,
640,
13,
42832,
7,
3064,
8,
628,
220,
220,
220,
1303,
12578,
22082,
13,
198,
220,
220,
220,
1303,
5740,
25,
33520,
22082,
318,
2440,
11,
11305,
262,
13186,
1838,
340,
13611,
13,
198,
220,
220,
220,
3601,
7,
15750,
13,
29647,
28955,
198
] | 2.838275 | 371 |
from rti_python.Ensemble.Ensemble import Ensemble
import logging
class InstrumentVelocity:
"""
Instrument Velocity DataSet.
[Bin x Beam] data.
"""
def decode(self, data):
"""
Take the data bytearray. Decode the data to populate
the velocities.
:param data: Bytearray for the dataset.
"""
packetpointer = Ensemble.GetBaseDataSize(self.name_len)
for beam in range(self.element_multiplier):
for bin_num in range(self.num_elements):
self.Velocities[bin_num][beam] = Ensemble.GetFloat(packetpointer, Ensemble().BytesInFloat, data)
packetpointer += Ensemble().BytesInFloat
logging.debug(self.Velocities)
def encode(self):
"""
Encode the data into RTB format.
:return:
"""
result = []
# Generate header
result += Ensemble.generate_header(self.ds_type,
self.num_elements,
self.element_multiplier,
self.image,
self.name_len,
self.Name)
# Add the data
for beam in range(self.element_multiplier):
for bin_num in range(self.num_elements):
val = self.Velocities[bin_num][beam]
result += Ensemble.float_to_bytes(val)
return result
def encode_csv(self, dt, ss_code, ss_config, blank, bin_size):
"""
Encode into CSV format.
:param dt: Datetime object.
:param ss_code: Subsystem code.
:param ss_config: Subsystem Configuration
:param blank: Blank or First bin position in meters.
:param bin_size: Bin size in meters.
:return: List of CSV lines.
"""
str_result = []
for beam in range(self.element_multiplier):
for bin_num in range(self.num_elements):
# Get the value
val = self.Velocities[bin_num][beam]
# Create the CSV string
str_result.append(Ensemble.gen_csv_line(dt, Ensemble.CSV_INSTR_VEL, ss_code, ss_config, bin_num, beam, blank, bin_size, val))
return str_result
| [
6738,
374,
20259,
62,
29412,
13,
4834,
15140,
13,
4834,
15140,
1330,
2039,
15140,
201,
198,
11748,
18931,
201,
198,
201,
198,
4871,
42410,
46261,
11683,
25,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
42410,
43137,
6060,
7248,
13,
201,
198,
220,
220,
220,
685,
33,
259,
2124,
25855,
60,
1366,
13,
201,
198,
220,
220,
220,
37227,
201,
198,
201,
198,
220,
220,
220,
825,
36899,
7,
944,
11,
1366,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
7214,
262,
1366,
416,
83,
451,
2433,
13,
220,
4280,
1098,
262,
1366,
284,
48040,
201,
198,
220,
220,
220,
220,
220,
220,
220,
262,
11555,
420,
871,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
1366,
25,
2750,
83,
451,
2433,
329,
262,
27039,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
19638,
29536,
796,
2039,
15140,
13,
3855,
14881,
6601,
10699,
7,
944,
13,
3672,
62,
11925,
8,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
329,
15584,
287,
2837,
7,
944,
13,
30854,
62,
47945,
959,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
9874,
62,
22510,
287,
2837,
7,
944,
13,
22510,
62,
68,
3639,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
46261,
420,
871,
58,
8800,
62,
22510,
7131,
40045,
60,
796,
2039,
15140,
13,
3855,
43879,
7,
8002,
316,
29536,
11,
2039,
15140,
22446,
45992,
818,
43879,
11,
1366,
8,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19638,
29536,
15853,
2039,
15140,
22446,
45992,
818,
43879,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
18931,
13,
24442,
7,
944,
13,
46261,
420,
871,
8,
201,
198,
201,
198,
220,
220,
220,
825,
37773,
7,
944,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2039,
8189,
262,
1366,
656,
11923,
33,
5794,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
17635,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
2980,
378,
13639,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
15853,
2039,
15140,
13,
8612,
378,
62,
25677,
7,
944,
13,
9310,
62,
4906,
11,
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,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
22510,
62,
68,
3639,
11,
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,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
30854,
62,
47945,
959,
11,
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,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
9060,
11,
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,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
3672,
62,
11925,
11,
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,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
5376,
8,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
3060,
262,
1366,
201,
198,
220,
220,
220,
220,
220,
220,
220,
329,
15584,
287,
2837,
7,
944,
13,
30854,
62,
47945,
959,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
9874,
62,
22510,
287,
2837,
7,
944,
13,
22510,
62,
68,
3639,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
2116,
13,
46261,
420,
871,
58,
8800,
62,
22510,
7131,
40045,
60,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
15853,
2039,
15140,
13,
22468,
62,
1462,
62,
33661,
7,
2100,
8,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
1255,
201,
198,
201,
198,
220,
220,
220,
825,
37773,
62,
40664,
7,
944,
11,
288,
83,
11,
37786,
62,
8189,
11,
37786,
62,
11250,
11,
9178,
11,
9874,
62,
7857,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
2039,
8189,
656,
44189,
5794,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
288,
83,
25,
16092,
8079,
2134,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
37786,
62,
8189,
25,
3834,
10057,
2438,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
37786,
62,
11250,
25,
3834,
10057,
28373,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
9178,
25,
31990,
393,
3274,
9874,
2292,
287,
10700,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
17143,
9874,
62,
7857,
25,
20828,
2546,
287,
10700,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1058,
7783,
25,
7343,
286,
44189,
3951,
13,
201,
198,
220,
220,
220,
220,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
220,
220,
220,
220,
965,
62,
20274,
796,
17635,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
329,
15584,
287,
2837,
7,
944,
13,
30854,
62,
47945,
959,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
9874,
62,
22510,
287,
2837,
7,
944,
13,
22510,
62,
68,
3639,
2599,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
3497,
262,
1988,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
796,
2116,
13,
46261,
420,
871,
58,
8800,
62,
22510,
7131,
40045,
60,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
13610,
262,
44189,
4731,
201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
965,
62,
20274,
13,
33295,
7,
4834,
15140,
13,
5235,
62,
40664,
62,
1370,
7,
28664,
11,
2039,
15140,
13,
7902,
53,
62,
1268,
18601,
62,
18697,
11,
37786,
62,
8189,
11,
37786,
62,
11250,
11,
9874,
62,
22510,
11,
15584,
11,
9178,
11,
9874,
62,
7857,
11,
1188,
4008,
201,
198,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
965,
62,
20274,
201,
198,
201,
198
] | 1.936637 | 1,231 |
from django.core.management.base import BaseCommand, CommandError
from odds.domain.models.manager.betTypeManager import BetTypeManager
from odds.domain.models.bet import Bet
from odds.domain.models.sureBet import SureBet
from odds.domain.models.manager.SureBetManager import SureBetManager
from odds.domain.models.event import Event
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
11,
9455,
12331,
198,
198,
6738,
10402,
13,
27830,
13,
27530,
13,
37153,
13,
11181,
6030,
13511,
1330,
5147,
6030,
13511,
198,
6738,
10402,
13,
27830,
13,
27530,
13,
11181,
1330,
5147,
198,
6738,
10402,
13,
27830,
13,
27530,
13,
19532,
13056,
1330,
10889,
13056,
198,
6738,
10402,
13,
27830,
13,
27530,
13,
37153,
13,
19457,
13056,
13511,
1330,
10889,
13056,
13511,
198,
6738,
10402,
13,
27830,
13,
27530,
13,
15596,
1330,
8558,
628
] | 3.895349 | 86 |
# -*- coding: utf-8 -*-
# flake8: noqa
"""
Defintion of the campaign and datasets for 2016 legacy rereco data.
"""
import order as od
from analysis.config.processes import *
# campaign
campaign_name = "Run2_pp_13TeV_Legacy16"
campaign = od.Campaign(
campaign_name, 2,
ecm=13,
bx=25,
)
# datasets
dataset_data_B_ee = od.Dataset(
"data_B_ee", 1,
campaign=campaign,
is_data=True,
n_files=922,
keys=["/DoubleEG/Run2016B-17Jul2018_ver2-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_C_ee = od.Dataset(
"data_C_ee", 2,
campaign=campaign,
is_data=True,
n_files=427,
keys=["/DoubleEG/Run2016C-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_D_ee = od.Dataset(
"data_D_ee", 3,
campaign=campaign,
is_data=True,
n_files=471,
keys=["/DoubleEG/Run2016D-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_E_ee = od.Dataset(
"data_E_ee", 4,
campaign=campaign,
is_data=True,
n_files=375,
keys=["/DoubleEG/Run2016E-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_F_ee = od.Dataset(
"data_F_ee", 5,
campaign=campaign,
is_data=True,
n_files=309,
keys=["/DoubleEG/Run2016F-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_G_ee = od.Dataset(
"data_G_ee", 6,
campaign=campaign,
is_data=True,
n_files=715,
keys=["/DoubleEG/Run2016G-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_H_ee = od.Dataset(
"data_H_ee", 7,
campaign=campaign,
is_data=True,
n_files=736,
keys=["/DoubleEG/Run2016H-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
datasets_data_ee = [
dataset_data_B_ee, dataset_data_C_ee, dataset_data_D_ee, dataset_data_E_ee,
dataset_data_F_ee, dataset_data_G_ee, dataset_data_H_ee
]
dataset_data_B_emu = od.Dataset(
"data_B_emu", 11,
campaign=campaign,
is_data=True,
n_files=249,
keys=["/MuonEG/Run2016B-17Jul2018_ver2-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_C_emu = od.Dataset(
"data_C_emu", 12,
campaign=campaign,
is_data=True,
n_files=112,
keys=["/MuonEG/Run2016C-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_D_emu = od.Dataset(
"data_D_emu", 13,
campaign=campaign,
is_data=True,
n_files=192,
keys=["/MuonEG/Run2016D-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_E_emu = od.Dataset(
"data_E_emu", 14,
campaign=campaign,
is_data=True,
n_files=209,
keys=["/MuonEG/Run2016E-17Jul2018-v2/MINIAOD"],
context=campaign_name,
)
dataset_data_F_emu = od.Dataset(
"data_F_emu", 15,
campaign=campaign,
is_data=True,
n_files=159,
keys=["/MuonEG/Run2016F-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_G_emu = od.Dataset(
"data_G_emu", 16,
campaign=campaign,
is_data=True,
n_files=302,
keys=["/MuonEG/Run2016G-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_H_emu = od.Dataset(
"data_H_emu", 17,
campaign=campaign,
is_data=True,
n_files=267,
keys=["/MuonEG/Run2016H-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
datasets_data_emu = [
dataset_data_B_emu, dataset_data_C_emu, dataset_data_D_emu, dataset_data_E_emu,
dataset_data_F_emu, dataset_data_G_emu, dataset_data_H_emu
]
dataset_data_B_mumu = od.Dataset(
"data_B_mumu", 21,
campaign=campaign,
is_data=True,
n_files=451,
keys=["/DoubleMuon/Run2016B-17Jul2018_ver2-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_C_mumu = od.Dataset(
"data_C_mumu", 22,
campaign=campaign,
is_data=True,
n_files=203,
keys=["/DoubleMuon/Run2016C-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_D_mumu = od.Dataset(
"data_D_mumu", 23,
campaign=campaign,
is_data=True,
n_files=215,
keys=["/DoubleMuon/Run2016D-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_E_mumu = od.Dataset(
"data_E_mumu", 24,
campaign=campaign,
is_data=True,
n_files=186,
keys=["/DoubleMuon/Run2016E-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_F_mumu = od.Dataset(
"data_F_mumu", 25,
campaign=campaign,
is_data=True,
n_files=155,
keys=["/DoubleMuon/Run2016F-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_G_mumu = od.Dataset(
"data_G_mumu", 26,
campaign=campaign,
is_data=True,
n_files=346,
keys=["/DoubleMuon/Run2016G-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
dataset_data_H_mumu = od.Dataset(
"data_H_mumu", 27,
campaign=campaign,
is_data=True,
n_files=378,
keys=["/DoubleMuon/Run2016H-17Jul2018-v1/MINIAOD"],
context=campaign_name,
)
datasets_data_mumu = [
dataset_data_B_mumu, dataset_data_C_mumu, dataset_data_D_mumu, dataset_data_E_mumu,
dataset_data_F_mumu, dataset_data_G_mumu, dataset_data_H_mumu
]
# single electron
dataset_data_B_e = od.Dataset(
"data_B_e", 31,
campaign = campaign,
n_files=11+1560,
keys=["/SingleElectron/Run2016B-17Jul2018_ver1-v1/MINIAOD",
"/SingleElectron/Run2016B-17Jul2018_ver2-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_C_e = od.Dataset(
"data_C_e", 32,
campaign = campaign,
n_files=674,
keys=["/SingleElectron/Run2016C-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_D_e = od.Dataset(
"data_D_e", 33,
campaign = campaign,
n_files=966,
keys=["/SingleElectron/Run2016D-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_E_e = od.Dataset(
"data_E_e", 34,
campaign = campaign,
n_files=819,
keys=["/SingleElectron/Run2016E-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_F_e = od.Dataset(
"data_F_e", 35,
campaign = campaign,
n_files=499,
keys=["/SingleElectron/Run2016F-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_G_e = od.Dataset(
"data_G_e", 36,
campaign = campaign,
n_files=1188,
keys=["/SingleElectron/Run2016G-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_H_e = od.Dataset(
"data_H_e", 37,
campaign = campaign,
n_files=968,
keys=["/SingleElectron/Run2016H-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
datasets_data_e = [
dataset_data_B_e, dataset_data_C_e, dataset_data_D_e, dataset_data_E_e,
dataset_data_F_e, dataset_data_G_e, dataset_data_H_e
]
# single muon
dataset_data_B_mu = od.Dataset(
"data_B_mu", 41,
campaign = campaign,
n_files=19+915,
keys=["/SingleMuon/Run2016B-17Jul2018_ver1-v1/MINIAOD",
"/SingleMuon/Run2016B-17Jul2018_ver2-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_C_mu = od.Dataset(
"data_C_mu", 42,
campaign = campaign,
n_files=369,
keys=["/SingleMuon/Run2016C-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_D_mu = od.Dataset(
"data_D_mu", 43,
campaign = campaign,
n_files=670,
keys=["/SingleMuon/Run2016D-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_E_mu = od.Dataset(
"data_E_mu", 44,
campaign = campaign,
n_files=565,
keys=["/SingleMuon/Run2016E-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_F_mu = od.Dataset(
"data_F_mu", 45,
campaign = campaign,
n_files=462,
keys=["/SingleMuon/Run2016F-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_G_mu = od.Dataset(
"data_G_mu", 46,
campaign = campaign,
n_files=963,
keys=["/SingleMuon/Run2016G-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
dataset_data_H_mu = od.Dataset(
"data_H_mu", 47,
campaign = campaign,
n_files=1131,
keys=["/SingleMuon/Run2016H-17Jul2018-v1/MINIAOD"],
is_data=True,
context=campaign_name,
)
datasets_data_mu = [
dataset_data_B_mu, dataset_data_C_mu, dataset_data_D_mu, dataset_data_E_mu,
dataset_data_F_mu, dataset_data_G_mu, dataset_data_H_mu
]
# MC datasets
# tt
dataset_tt_dl = od.Dataset(
"tt_dl", 101,
campaign=campaign,
n_files=777,
keys=[
"/TTTo2L2Nu_TuneCP5_PSweights_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM",
],
context=campaign_name,
)
dataset_tt_sl = od.Dataset(
"tt_sl", 102,
campaign=campaign,
n_files=1105,
keys=[
"/TTToSemiLeptonic_TuneCP5_PSweights_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM",
],
context=campaign_name,
)
# Drell-Yan
dataset_dy_lep_10To50 = od.Dataset(
"dy_lep_10To50", 2230,
campaign=campaign,
n_files=264,
keys=[
"/DYJetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM",
],
context=campaign_name,
)
dataset_dy_lep_50ToInf = od.Dataset(
"dy_lep_50ToInf", 2231,
campaign=campaign,
n_files=360+701,
keys=[
"/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v2/MINIAODSIM",
"/DYJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext2-v2/MINIAODSIM",
],
context=campaign_name,
)
# single top
# s-channel
dataset_st_s_lep = od.Dataset(
"st_s_lep", 300,
campaign=campaign,
n_files=104,
keys=[
"/ST_s-channel_4f_leptonDecays_TuneCP5_PSweights_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM",
],
context=campaign_name,
)
# t-channel
dataset_st_t_t = od.Dataset(
"st_t_t", 301,
campaign=campaign,
n_files=307,
keys= [
"/ST_t-channel_top_4f_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM",
],
context=campaign_name,
)
dataset_st_t_tbar = od.Dataset(
"st_t_tbar", 302,
campaign=campaign,
n_files=224,
keys= [
"/ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM",
],
context=campaign_name,
)
# tW-channel
dataset_st_tW_t = od.Dataset(
"st_tW_t", 321,
campaign=campaign,
n_files=65,
keys=[
"/ST_tW_top_5f_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM",
],
context=campaign_name,
)
dataset_st_tW_tbar = od.Dataset(
"st_tW_tbar", 322,
campaign=campaign,
n_files=98,
keys=[
"/ST_tW_antitop_5f_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM",
],
context=campaign_name,
)
# diboson
dataset_WW = od.Dataset(
"WW", 401,
campaign=campaign,
n_files=7+53,
keys=[
"/WW_TuneCUETP8M1_13TeV-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM",
"/WW_TuneCUETP8M1_13TeV-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v2/MINIAODSIM",
],
context=campaign_name,
)
dataset_WZ = od.Dataset(
"WZ", 402,
campaign=campaign,
n_files=8+29,
keys=[
"/WZ_TuneCUETP8M1_13TeV-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM",
"/WZ_TuneCUETP8M1_13TeV-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext1-v2/MINIAODSIM",
],
context=campaign_name,
)
dataset_ZZ = od.Dataset(
"ZZ", 403,
campaign=campaign,
n_files=7,
keys=[
"/ZZ_TuneCUETP8M1_13TeV-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM",
],
context=campaign_name,
)
# W + jets
dataset_W_lep = od.Dataset(
"W_lep", 500,
campaign=campaign,
n_files=215+410,
keys=[
"/WJetsToLNu_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM",
"/WJetsToLNu_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext2-v2/MINIAODSIM"
],
context=campaign_name,
)
# tt+X
dataset_ttH_bb = od.Dataset(
"ttH_bb", 601,
campaign=campaign,
n_files=188,
keys=[
"/ttHTobb_M125_TuneCP5_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM",
],
context=campaign_name,
)
dataset_ttH_nonbb = od.Dataset(
"ttH_nonbb", 602,
campaign=campaign,
n_files=143,
keys=[
"/ttHToNonbb_M125_TuneCP5_13TeV-powheg-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v1/MINIAODSIM",
],
context=campaign_name,
)
dataset_ttWJets_lep = od.Dataset(
"ttWJets_lep", 700,
campaign=campaign,
n_files=31,
keys=[
"/TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext2-v1/MINIAODSIM",
],
context=campaign_name,
)
dataset_ttWJets_had = od.Dataset(
"ttWJets_had", 701,
campaign=campaign,
n_files=7,
keys=[
"/TTWJetsToQQ_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM",
],
context=campaign_name,
)
dataset_ttZJets_lep = od.Dataset(
"ttZJets_lep", 710,
campaign=campaign,
n_files=49+48,
keys=[
"/TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext2-v1/MINIAODSIM",
"/TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3_ext3-v1/MINIAODSIM",
],
context=campaign_name,
)
dataset_ttZJets_had = od.Dataset(
"ttZJets_had", 711,
campaign=campaign,
n_files=7,
keys=[
"/TTZToQQ_TuneCUETP8M1_13TeV-amcatnlo-pythia8/RunIISummer16MiniAODv3-PUMoriond17_94X_mcRun2_asymptotic_v3-v2/MINIAODSIM",
],
context=campaign_name,
)
# link processes to datasets
for d in datasets_data_ee:
d.add_process(process_data_ee)
for d in datasets_data_emu:
d.add_process(process_data_emu)
for d in datasets_data_mumu:
d.add_process(process_data_mumu)
for d in datasets_data_e:
d.add_process(process_data_e)
for d in datasets_data_mu:
d.add_process(process_data_mu)
dataset_tt_dl.add_process(process_tt_dl)
dataset_tt_sl.add_process(process_tt_sl)
dataset_dy_lep_10To50.add_process(process_dy_lep_10To50)
dataset_dy_lep_50ToInf.add_process(process_dy_lep_50ToInf)
dataset_st_s_lep.add_process(process_st_s_lep)
dataset_st_t_t.add_process(process_st_t_t)
dataset_st_t_tbar.add_process(process_st_t_tbar)
dataset_st_tW_t.add_process(process_st_tW_t)
dataset_st_tW_tbar.add_process(process_st_tW_tbar)
dataset_WW.add_process(process_WW)
dataset_WZ.add_process(process_WZ)
dataset_ZZ.add_process(process_ZZ)
dataset_W_lep.add_process(process_W_lep)
dataset_ttH_bb.add_process(process_ttH_bb)
dataset_ttH_nonbb.add_process(process_ttH_nonbb)
dataset_ttWJets_lep.add_process(process_ttWJets_lep)
dataset_ttWJets_had.add_process(process_ttWJets_had)
dataset_ttZJets_lep.add_process(process_ttZJets_lep)
dataset_ttZJets_had.add_process(process_ttZJets_had)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
781,
539,
23,
25,
645,
20402,
198,
198,
37811,
198,
7469,
600,
295,
286,
262,
1923,
290,
40522,
329,
1584,
10655,
302,
260,
1073,
1366,
13,
198,
37811,
628,
198,
11748,
1502,
355,
16298,
198,
198,
6738,
3781,
13,
11250,
13,
14681,
274,
1330,
1635,
628,
198,
2,
1923,
198,
35012,
62,
3672,
796,
366,
10987,
17,
62,
381,
62,
1485,
6767,
53,
62,
11484,
1590,
1433,
1,
198,
35012,
796,
16298,
13,
46102,
7,
198,
220,
220,
220,
1923,
62,
3672,
11,
362,
11,
198,
220,
220,
220,
9940,
76,
28,
1485,
11,
198,
220,
220,
220,
275,
87,
28,
1495,
11,
198,
8,
198,
198,
2,
40522,
198,
198,
19608,
292,
316,
62,
7890,
62,
33,
62,
1453,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
33,
62,
1453,
1600,
352,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
24,
1828,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
7156,
14,
10987,
5304,
33,
12,
1558,
16980,
7908,
62,
332,
17,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
34,
62,
1453,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
34,
62,
1453,
1600,
362,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
42363,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
7156,
14,
10987,
5304,
34,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
35,
62,
1453,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
35,
62,
1453,
1600,
513,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
38339,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
7156,
14,
10987,
5304,
35,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
36,
62,
1453,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
36,
62,
1453,
1600,
604,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22318,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
7156,
14,
10987,
5304,
36,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
37,
62,
1453,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
37,
62,
1453,
1600,
642,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
26895,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
7156,
14,
10987,
5304,
37,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
38,
62,
1453,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
38,
62,
1453,
1600,
718,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22,
1314,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
7156,
14,
10987,
5304,
38,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
39,
62,
1453,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
39,
62,
1453,
1600,
767,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
49150,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
7156,
14,
10987,
5304,
39,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
1039,
62,
7890,
62,
1453,
796,
685,
198,
220,
220,
220,
27039,
62,
7890,
62,
33,
62,
1453,
11,
27039,
62,
7890,
62,
34,
62,
1453,
11,
27039,
62,
7890,
62,
35,
62,
1453,
11,
27039,
62,
7890,
62,
36,
62,
1453,
11,
198,
220,
220,
220,
27039,
62,
7890,
62,
37,
62,
1453,
11,
27039,
62,
7890,
62,
38,
62,
1453,
11,
27039,
62,
7890,
62,
39,
62,
1453,
198,
60,
198,
198,
19608,
292,
316,
62,
7890,
62,
33,
62,
368,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
33,
62,
368,
84,
1600,
1367,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
21626,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
33239,
261,
7156,
14,
10987,
5304,
33,
12,
1558,
16980,
7908,
62,
332,
17,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
34,
62,
368,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
34,
62,
368,
84,
1600,
1105,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
14686,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
33239,
261,
7156,
14,
10987,
5304,
34,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
35,
62,
368,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
35,
62,
368,
84,
1600,
1511,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
17477,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
33239,
261,
7156,
14,
10987,
5304,
35,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
36,
62,
368,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
36,
62,
368,
84,
1600,
1478,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22567,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
33239,
261,
7156,
14,
10987,
5304,
36,
12,
1558,
16980,
7908,
12,
85,
17,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
37,
62,
368,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
37,
62,
368,
84,
1600,
1315,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
19707,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
33239,
261,
7156,
14,
10987,
5304,
37,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
38,
62,
368,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
38,
62,
368,
84,
1600,
1467,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22709,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
33239,
261,
7156,
14,
10987,
5304,
38,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
39,
62,
368,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
39,
62,
368,
84,
1600,
1596,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
25674,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
33239,
261,
7156,
14,
10987,
5304,
39,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
1039,
62,
7890,
62,
368,
84,
796,
685,
198,
220,
220,
220,
27039,
62,
7890,
62,
33,
62,
368,
84,
11,
27039,
62,
7890,
62,
34,
62,
368,
84,
11,
27039,
62,
7890,
62,
35,
62,
368,
84,
11,
27039,
62,
7890,
62,
36,
62,
368,
84,
11,
198,
220,
220,
220,
27039,
62,
7890,
62,
37,
62,
368,
84,
11,
27039,
62,
7890,
62,
38,
62,
368,
84,
11,
27039,
62,
7890,
62,
39,
62,
368,
84,
198,
60,
198,
198,
19608,
292,
316,
62,
7890,
62,
33,
62,
76,
388,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
33,
62,
76,
388,
84,
1600,
2310,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
36330,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
33239,
261,
14,
10987,
5304,
33,
12,
1558,
16980,
7908,
62,
332,
17,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
34,
62,
76,
388,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
34,
62,
76,
388,
84,
1600,
2534,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22416,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
33239,
261,
14,
10987,
5304,
34,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
35,
62,
76,
388,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
35,
62,
76,
388,
84,
1600,
2242,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
23349,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
33239,
261,
14,
10987,
5304,
35,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
36,
62,
76,
388,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
36,
62,
76,
388,
84,
1600,
1987,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
25096,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
33239,
261,
14,
10987,
5304,
36,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
37,
62,
76,
388,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
37,
62,
76,
388,
84,
1600,
1679,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
18742,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
33239,
261,
14,
10987,
5304,
37,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
38,
62,
76,
388,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
38,
62,
76,
388,
84,
1600,
2608,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
30557,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
33239,
261,
14,
10987,
5304,
38,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
39,
62,
76,
388,
84,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
39,
62,
76,
388,
84,
1600,
2681,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
30695,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
25628,
33239,
261,
14,
10987,
5304,
39,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
1039,
62,
7890,
62,
76,
388,
84,
796,
685,
198,
220,
220,
220,
27039,
62,
7890,
62,
33,
62,
76,
388,
84,
11,
27039,
62,
7890,
62,
34,
62,
76,
388,
84,
11,
27039,
62,
7890,
62,
35,
62,
76,
388,
84,
11,
27039,
62,
7890,
62,
36,
62,
76,
388,
84,
11,
198,
220,
220,
220,
27039,
62,
7890,
62,
37,
62,
76,
388,
84,
11,
27039,
62,
7890,
62,
38,
62,
76,
388,
84,
11,
27039,
62,
7890,
62,
39,
62,
76,
388,
84,
198,
60,
198,
198,
2,
2060,
11538,
198,
198,
19608,
292,
316,
62,
7890,
62,
33,
62,
68,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
33,
62,
68,
1600,
3261,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
1157,
10,
1314,
1899,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
19453,
1313,
14,
10987,
5304,
33,
12,
1558,
16980,
7908,
62,
332,
16,
12,
85,
16,
14,
23678,
3539,
3727,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
28008,
19453,
1313,
14,
10987,
5304,
33,
12,
1558,
16980,
7908,
62,
332,
17,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
34,
62,
68,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
34,
62,
68,
1600,
3933,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
45385,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
19453,
1313,
14,
10987,
5304,
34,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
35,
62,
68,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
35,
62,
68,
1600,
4747,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
24,
2791,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
19453,
1313,
14,
10987,
5304,
35,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
36,
62,
68,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
36,
62,
68,
1600,
4974,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
23,
1129,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
19453,
1313,
14,
10987,
5304,
36,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
37,
62,
68,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
37,
62,
68,
1600,
3439,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
28324,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
19453,
1313,
14,
10987,
5304,
37,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
38,
62,
68,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
38,
62,
68,
1600,
4570,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
1157,
3459,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
19453,
1313,
14,
10987,
5304,
38,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
39,
62,
68,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
39,
62,
68,
1600,
5214,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
38956,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
19453,
1313,
14,
10987,
5304,
39,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
1039,
62,
7890,
62,
68,
796,
685,
198,
220,
220,
220,
27039,
62,
7890,
62,
33,
62,
68,
11,
27039,
62,
7890,
62,
34,
62,
68,
11,
27039,
62,
7890,
62,
35,
62,
68,
11,
27039,
62,
7890,
62,
36,
62,
68,
11,
198,
220,
220,
220,
27039,
62,
7890,
62,
37,
62,
68,
11,
27039,
62,
7890,
62,
38,
62,
68,
11,
27039,
62,
7890,
62,
39,
62,
68,
198,
60,
198,
198,
2,
2060,
38779,
261,
198,
198,
19608,
292,
316,
62,
7890,
62,
33,
62,
30300,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
33,
62,
30300,
1600,
6073,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
1129,
10,
40248,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
33239,
261,
14,
10987,
5304,
33,
12,
1558,
16980,
7908,
62,
332,
16,
12,
85,
16,
14,
23678,
3539,
3727,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
28008,
33239,
261,
14,
10987,
5304,
33,
12,
1558,
16980,
7908,
62,
332,
17,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
34,
62,
30300,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
34,
62,
30300,
1600,
5433,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
30803,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
33239,
261,
14,
10987,
5304,
34,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
35,
62,
30300,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
35,
62,
30300,
1600,
5946,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
43798,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
33239,
261,
14,
10987,
5304,
35,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
36,
62,
30300,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
36,
62,
30300,
1600,
5846,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
47372,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
33239,
261,
14,
10987,
5304,
36,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
37,
62,
30300,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
37,
62,
30300,
1600,
4153,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
39997,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
33239,
261,
14,
10987,
5304,
37,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
38,
62,
30300,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
38,
62,
30300,
1600,
6337,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
4846,
18,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
33239,
261,
14,
10987,
5304,
38,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
7890,
62,
39,
62,
30300,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
7890,
62,
39,
62,
30300,
1600,
6298,
11,
198,
220,
220,
220,
1923,
796,
1923,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
1157,
3132,
11,
198,
220,
220,
220,
8251,
28,
14692,
14,
28008,
33239,
261,
14,
10987,
5304,
39,
12,
1558,
16980,
7908,
12,
85,
16,
14,
23678,
3539,
3727,
33116,
198,
220,
220,
220,
318,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
1039,
62,
7890,
62,
30300,
796,
685,
198,
220,
220,
220,
27039,
62,
7890,
62,
33,
62,
30300,
11,
27039,
62,
7890,
62,
34,
62,
30300,
11,
27039,
62,
7890,
62,
35,
62,
30300,
11,
27039,
62,
7890,
62,
36,
62,
30300,
11,
198,
220,
220,
220,
27039,
62,
7890,
62,
37,
62,
30300,
11,
27039,
62,
7890,
62,
38,
62,
30300,
11,
27039,
62,
7890,
62,
39,
62,
30300,
198,
60,
198,
198,
2,
13122,
40522,
198,
198,
2,
256,
83,
198,
198,
19608,
292,
316,
62,
926,
62,
25404,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
926,
62,
25404,
1600,
8949,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
29331,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
15751,
2514,
17,
43,
17,
45,
84,
62,
51,
1726,
8697,
20,
62,
3705,
43775,
62,
1485,
6767,
53,
12,
79,
322,
258,
70,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
926,
62,
6649,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
926,
62,
6649,
1600,
15143,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
11442,
20,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
15751,
2514,
13900,
72,
3123,
457,
9229,
62,
51,
1726,
8697,
20,
62,
3705,
43775,
62,
1485,
6767,
53,
12,
79,
322,
258,
70,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
2,
360,
11252,
12,
49664,
198,
198,
19608,
292,
316,
62,
9892,
62,
293,
79,
62,
940,
2514,
1120,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
9892,
62,
293,
79,
62,
940,
2514,
1120,
1600,
2534,
1270,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
18897,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
35,
56,
41,
1039,
2514,
3069,
62,
44,
12,
940,
1462,
1120,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
9937,
34960,
5805,
44,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
9892,
62,
293,
79,
62,
1120,
2514,
18943,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
9892,
62,
293,
79,
62,
1120,
2514,
18943,
1600,
362,
25667,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
15277,
10,
41583,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
35,
56,
41,
1039,
2514,
3069,
62,
44,
12,
1120,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
9937,
34960,
5805,
44,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
62,
2302,
16,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
35,
56,
41,
1039,
2514,
3069,
62,
44,
12,
1120,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
9937,
34960,
5805,
44,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
62,
2302,
17,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
2,
2060,
1353,
198,
198,
2,
264,
12,
17620,
198,
19608,
292,
316,
62,
301,
62,
82,
62,
293,
79,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
301,
62,
82,
62,
293,
79,
1600,
5867,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
13464,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
2257,
62,
82,
12,
17620,
62,
19,
69,
62,
293,
10972,
10707,
592,
62,
51,
1726,
8697,
20,
62,
3705,
43775,
62,
1485,
6767,
53,
12,
321,
9246,
77,
5439,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
2,
256,
12,
17620,
198,
19608,
292,
316,
62,
301,
62,
83,
62,
83,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
301,
62,
83,
62,
83,
1600,
25643,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22996,
11,
198,
220,
220,
220,
8251,
28,
685,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
2257,
62,
83,
12,
17620,
62,
4852,
62,
19,
69,
62,
818,
5731,
10707,
592,
62,
51,
1726,
8697,
20,
62,
3705,
43775,
62,
1485,
6767,
53,
12,
79,
322,
258,
70,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
301,
62,
83,
62,
83,
5657,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
301,
62,
83,
62,
83,
5657,
1600,
32591,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
24137,
11,
198,
220,
220,
220,
8251,
28,
685,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
2257,
62,
83,
12,
17620,
62,
415,
270,
404,
62,
19,
69,
62,
818,
5731,
10707,
592,
62,
51,
1726,
8697,
20,
62,
3705,
43775,
62,
1485,
6767,
53,
12,
79,
322,
258,
70,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
628,
198,
2,
256,
54,
12,
17620,
198,
19608,
292,
316,
62,
301,
62,
83,
54,
62,
83,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
301,
62,
83,
54,
62,
83,
1600,
39595,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
2996,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
2257,
62,
83,
54,
62,
4852,
62,
20,
69,
62,
259,
5731,
10707,
592,
62,
51,
1726,
8697,
20,
62,
3705,
43775,
62,
1485,
6767,
53,
12,
79,
322,
258,
70,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
301,
62,
83,
54,
62,
83,
5657,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
301,
62,
83,
54,
62,
83,
5657,
1600,
38831,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
4089,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
2257,
62,
83,
54,
62,
415,
270,
404,
62,
20,
69,
62,
259,
5731,
10707,
592,
62,
51,
1726,
8697,
20,
62,
3705,
43775,
62,
1485,
6767,
53,
12,
79,
322,
258,
70,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
2,
288,
571,
418,
261,
198,
198,
19608,
292,
316,
62,
17947,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
17947,
1600,
22219,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22,
10,
4310,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
17947,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
17947,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
62,
2302,
16,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
54,
57,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
54,
57,
1600,
42622,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
23,
10,
1959,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
54,
57,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
54,
57,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
62,
2302,
16,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
30148,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
30148,
1600,
38210,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
30148,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
2,
370,
1343,
20792,
198,
198,
19608,
292,
316,
62,
54,
62,
293,
79,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
54,
62,
293,
79,
1600,
5323,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
23349,
10,
33289,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
54,
41,
1039,
2514,
43,
45,
84,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
9937,
34960,
5805,
44,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
54,
41,
1039,
2514,
43,
45,
84,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
9937,
34960,
5805,
44,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
62,
2302,
17,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
2,
256,
83,
10,
55,
198,
198,
19608,
292,
316,
62,
926,
39,
62,
11848,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
926,
39,
62,
11848,
1600,
49231,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
20356,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
926,
6535,
21963,
62,
44,
11623,
62,
51,
1726,
8697,
20,
62,
1485,
6767,
53,
12,
79,
322,
258,
70,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
926,
39,
62,
13159,
11848,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
926,
39,
62,
13159,
11848,
1600,
718,
2999,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
21139,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
926,
39,
2514,
15419,
11848,
62,
44,
11623,
62,
51,
1726,
8697,
20,
62,
1485,
6767,
53,
12,
79,
322,
258,
70,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
926,
54,
41,
1039,
62,
293,
79,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
926,
54,
41,
1039,
62,
293,
79,
1600,
13037,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
3132,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
15751,
54,
41,
1039,
2514,
43,
45,
84,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
321,
9246,
77,
5439,
17213,
17213,
12,
9937,
39706,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
62,
2302,
17,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
926,
54,
41,
1039,
62,
18108,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
926,
54,
41,
1039,
62,
18108,
1600,
48173,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
15751,
54,
41,
1039,
2514,
48,
48,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
321,
9246,
77,
5439,
17213,
17213,
12,
9937,
39706,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
926,
57,
41,
1039,
62,
293,
79,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
926,
57,
41,
1039,
62,
293,
79,
1600,
767,
940,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
2920,
10,
2780,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
15751,
57,
2514,
3069,
45,
84,
45,
84,
62,
44,
12,
940,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
321,
9246,
77,
5439,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
62,
2302,
17,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
15751,
57,
2514,
3069,
45,
84,
45,
84,
62,
44,
12,
940,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
321,
9246,
77,
5439,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
62,
2302,
18,
12,
85,
16,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
19608,
292,
316,
62,
926,
57,
41,
1039,
62,
18108,
796,
16298,
13,
27354,
292,
316,
7,
198,
220,
220,
220,
366,
926,
57,
41,
1039,
62,
18108,
1600,
767,
1157,
11,
198,
220,
220,
220,
1923,
28,
35012,
11,
198,
220,
220,
220,
299,
62,
16624,
28,
22,
11,
198,
220,
220,
220,
8251,
41888,
198,
220,
220,
220,
220,
220,
220,
220,
12813,
15751,
57,
2514,
48,
48,
62,
51,
1726,
43633,
2767,
47,
23,
44,
16,
62,
1485,
6767,
53,
12,
321,
9246,
77,
5439,
12,
79,
5272,
544,
23,
14,
10987,
40,
1797,
31647,
1433,
39234,
32,
3727,
85,
18,
12,
5105,
20044,
295,
67,
1558,
62,
5824,
55,
62,
23209,
10987,
17,
62,
4107,
76,
457,
6210,
62,
85,
18,
12,
85,
17,
14,
23678,
3539,
3727,
48913,
1600,
198,
220,
220,
220,
16589,
198,
220,
220,
220,
4732,
28,
35012,
62,
3672,
11,
198,
8,
198,
198,
2,
2792,
7767,
284,
40522,
198,
1640,
288,
287,
40522,
62,
7890,
62,
1453,
25,
198,
220,
220,
220,
288,
13,
2860,
62,
14681,
7,
14681,
62,
7890,
62,
1453,
8,
198,
1640,
288,
287,
40522,
62,
7890,
62,
368,
84,
25,
198,
220,
220,
220,
288,
13,
2860,
62,
14681,
7,
14681,
62,
7890,
62,
368,
84,
8,
198,
1640,
288,
287,
40522,
62,
7890,
62,
76,
388,
84,
25,
198,
220,
220,
220,
288,
13,
2860,
62,
14681,
7,
14681,
62,
7890,
62,
76,
388,
84,
8,
198,
1640,
288,
287,
40522,
62,
7890,
62,
68,
25,
198,
220,
220,
220,
288,
13,
2860,
62,
14681,
7,
14681,
62,
7890,
62,
68,
8,
198,
1640,
288,
287,
40522,
62,
7890,
62,
30300,
25,
198,
220,
220,
220,
288,
13,
2860,
62,
14681,
7,
14681,
62,
7890,
62,
30300,
8,
198,
198,
19608,
292,
316,
62,
926,
62,
25404,
13,
2860,
62,
14681,
7,
14681,
62,
926,
62,
25404,
8,
198,
19608,
292,
316,
62,
926,
62,
6649,
13,
2860,
62,
14681,
7,
14681,
62,
926,
62,
6649,
8,
198,
19608,
292,
316,
62,
9892,
62,
293,
79,
62,
940,
2514,
1120,
13,
2860,
62,
14681,
7,
14681,
62,
9892,
62,
293,
79,
62,
940,
2514,
1120,
8,
198,
19608,
292,
316,
62,
9892,
62,
293,
79,
62,
1120,
2514,
18943,
13,
2860,
62,
14681,
7,
14681,
62,
9892,
62,
293,
79,
62,
1120,
2514,
18943,
8,
198,
19608,
292,
316,
62,
301,
62,
82,
62,
293,
79,
13,
2860,
62,
14681,
7,
14681,
62,
301,
62,
82,
62,
293,
79,
8,
198,
19608,
292,
316,
62,
301,
62,
83,
62,
83,
13,
2860,
62,
14681,
7,
14681,
62,
301,
62,
83,
62,
83,
8,
198,
19608,
292,
316,
62,
301,
62,
83,
62,
83,
5657,
13,
2860,
62,
14681,
7,
14681,
62,
301,
62,
83,
62,
83,
5657,
8,
198,
19608,
292,
316,
62,
301,
62,
83,
54,
62,
83,
13,
2860,
62,
14681,
7,
14681,
62,
301,
62,
83,
54,
62,
83,
8,
198,
19608,
292,
316,
62,
301,
62,
83,
54,
62,
83,
5657,
13,
2860,
62,
14681,
7,
14681,
62,
301,
62,
83,
54,
62,
83,
5657,
8,
198,
19608,
292,
316,
62,
17947,
13,
2860,
62,
14681,
7,
14681,
62,
17947,
8,
198,
19608,
292,
316,
62,
54,
57,
13,
2860,
62,
14681,
7,
14681,
62,
54,
57,
8,
198,
19608,
292,
316,
62,
30148,
13,
2860,
62,
14681,
7,
14681,
62,
30148,
8,
198,
19608,
292,
316,
62,
54,
62,
293,
79,
13,
2860,
62,
14681,
7,
14681,
62,
54,
62,
293,
79,
8,
198,
19608,
292,
316,
62,
926,
39,
62,
11848,
13,
2860,
62,
14681,
7,
14681,
62,
926,
39,
62,
11848,
8,
198,
19608,
292,
316,
62,
926,
39,
62,
13159,
11848,
13,
2860,
62,
14681,
7,
14681,
62,
926,
39,
62,
13159,
11848,
8,
198,
19608,
292,
316,
62,
926,
54,
41,
1039,
62,
293,
79,
13,
2860,
62,
14681,
7,
14681,
62,
926,
54,
41,
1039,
62,
293,
79,
8,
198,
19608,
292,
316,
62,
926,
54,
41,
1039,
62,
18108,
13,
2860,
62,
14681,
7,
14681,
62,
926,
54,
41,
1039,
62,
18108,
8,
198,
19608,
292,
316,
62,
926,
57,
41,
1039,
62,
293,
79,
13,
2860,
62,
14681,
7,
14681,
62,
926,
57,
41,
1039,
62,
293,
79,
8,
198,
19608,
292,
316,
62,
926,
57,
41,
1039,
62,
18108,
13,
2860,
62,
14681,
7,
14681,
62,
926,
57,
41,
1039,
62,
18108,
8,
198
] | 1.936888 | 8,065 |
#!/usr/bin/env python
import csv
import argparse
import numpy as np
import pandas as pd
import tqdm
# Modified from: CosmiQ Solaris
# https://github.com/CosmiQ/solaris/blob/master/solaris/preproc/sar.py
def haversine(lat1, lon1, lat2, lon2, rad=False, radius=6.371E6):
"""
Haversine formula for distance between two points given their
latitude and longitude, assuming a spherical earth.
"""
if not rad:
lat1 = np.radians(lat1)
lon1 = np.radians(lon1)
lat2 = np.radians(lat2)
lon2 = np.radians(lon2)
dlat = lat2 - lat1
dlon = lon2 - lon1
a = np.sin(dlat/2)**2 + np.cos(lat1) * np.cos(lat2) * np.sin(dlon/2)**2
return 2 * radius * np.arcsin(np.sqrt(a))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('input_path')
parser.add_argument('output_path')
parser.add_argument('threshold', nargs='?', type=float, default=10.)
args = parser.parse_args()
main(args.input_path, args.output_path, args.threshold)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
269,
21370,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
256,
80,
36020,
198,
198,
2,
40499,
422,
25,
10437,
11632,
48,
12347,
271,
198,
2,
3740,
1378,
12567,
13,
785,
14,
36734,
11632,
48,
14,
82,
6192,
271,
14,
2436,
672,
14,
9866,
14,
82,
6192,
271,
14,
3866,
36942,
14,
82,
283,
13,
9078,
198,
4299,
387,
690,
500,
7,
15460,
16,
11,
300,
261,
16,
11,
3042,
17,
11,
300,
261,
17,
11,
2511,
28,
25101,
11,
16874,
28,
21,
13,
38056,
36,
21,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
9398,
690,
500,
10451,
329,
5253,
1022,
734,
2173,
1813,
511,
198,
220,
220,
220,
32477,
290,
890,
3984,
11,
13148,
257,
43180,
4534,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
611,
407,
2511,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3042,
16,
796,
45941,
13,
6335,
1547,
7,
15460,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
300,
261,
16,
796,
45941,
13,
6335,
1547,
7,
14995,
16,
8,
198,
220,
220,
220,
220,
220,
220,
220,
3042,
17,
796,
45941,
13,
6335,
1547,
7,
15460,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
300,
261,
17,
796,
45941,
13,
6335,
1547,
7,
14995,
17,
8,
198,
220,
220,
220,
288,
15460,
796,
3042,
17,
532,
3042,
16,
198,
220,
220,
220,
288,
14995,
796,
300,
261,
17,
532,
300,
261,
16,
198,
220,
220,
220,
257,
796,
45941,
13,
31369,
7,
67,
15460,
14,
17,
8,
1174,
17,
1343,
45941,
13,
6966,
7,
15460,
16,
8,
1635,
45941,
13,
6966,
7,
15460,
17,
8,
1635,
45941,
13,
31369,
7,
67,
14995,
14,
17,
8,
1174,
17,
198,
220,
220,
220,
1441,
362,
1635,
16874,
1635,
45941,
13,
5605,
31369,
7,
37659,
13,
31166,
17034,
7,
64,
4008,
628,
198,
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,
15414,
62,
6978,
11537,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
22915,
62,
6978,
11537,
198,
220,
220,
220,
30751,
13,
2860,
62,
49140,
10786,
400,
10126,
3256,
299,
22046,
11639,
30,
3256,
2099,
28,
22468,
11,
4277,
28,
940,
2014,
198,
220,
220,
220,
26498,
796,
30751,
13,
29572,
62,
22046,
3419,
198,
220,
220,
220,
1388,
7,
22046,
13,
15414,
62,
6978,
11,
26498,
13,
22915,
62,
6978,
11,
26498,
13,
400,
10126,
8,
198
] | 2.327314 | 443 |
# import the main window object (mw) from aqt
from aqt import mw
# import the "show info" tool from utils.py
from aqt.utils import showInfo
# import all of the Qt GUI library
from aqt.qt import *
# We're going to add a menu item below. First we want to create a function to
# be called when the menu item is activated.
# create a new menu item, "test"
action = QAction("test", mw)
# set it to call testFunction when it's clicked
action.triggered.connect(add_note)
# and add it to the tools menu
mw.form.menuTools.addAction(action)
action.setShortcut(QKeySequence("Ctrl+t"))
| [
2,
1330,
262,
1388,
4324,
2134,
357,
76,
86,
8,
422,
257,
39568,
198,
6738,
257,
39568,
1330,
285,
86,
198,
2,
1330,
262,
366,
12860,
7508,
1,
2891,
422,
3384,
4487,
13,
9078,
198,
6738,
257,
39568,
13,
26791,
1330,
905,
12360,
198,
2,
1330,
477,
286,
262,
33734,
25757,
5888,
198,
6738,
257,
39568,
13,
39568,
1330,
1635,
628,
198,
2,
775,
821,
1016,
284,
751,
257,
6859,
2378,
2174,
13,
3274,
356,
765,
284,
2251,
257,
2163,
284,
198,
2,
307,
1444,
618,
262,
6859,
2378,
318,
13906,
13,
628,
628,
198,
2,
2251,
257,
649,
6859,
2378,
11,
366,
9288,
1,
198,
2673,
796,
1195,
12502,
7203,
9288,
1600,
285,
86,
8,
198,
2,
900,
340,
284,
869,
1332,
22203,
618,
340,
338,
28384,
198,
2673,
13,
2213,
328,
10446,
13,
8443,
7,
2860,
62,
11295,
8,
198,
2,
290,
751,
340,
284,
262,
4899,
6859,
198,
76,
86,
13,
687,
13,
26272,
33637,
13,
2860,
12502,
7,
2673,
8,
198,
2673,
13,
2617,
16438,
8968,
7,
48,
9218,
44015,
594,
7203,
40069,
10,
83,
48774,
198
] | 3.20442 | 181 |
from __future__ import absolute_import
import logging
from flask import current_app
from changes.api.build_index import BuildIndexAPIView
from changes.models import ProjectStatus, Project, ProjectConfigError, ProjectOptionsHelper, Revision
from changes.utils.diff_parser import DiffParser
from changes.utils.project_trigger import files_changed_should_trigger_project
from changes.vcs.base import UnknownRevision
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
18931,
198,
198,
6738,
42903,
1330,
1459,
62,
1324,
198,
6738,
2458,
13,
15042,
13,
11249,
62,
9630,
1330,
10934,
15732,
2969,
3824,
769,
198,
6738,
2458,
13,
27530,
1330,
4935,
19580,
11,
4935,
11,
4935,
16934,
12331,
11,
4935,
29046,
47429,
11,
46604,
198,
6738,
2458,
13,
26791,
13,
26069,
62,
48610,
1330,
10631,
46677,
198,
6738,
2458,
13,
26791,
13,
16302,
62,
46284,
1330,
3696,
62,
40985,
62,
21754,
62,
46284,
62,
16302,
198,
6738,
2458,
13,
85,
6359,
13,
8692,
1330,
16185,
18009,
1166,
628,
198
] | 4.17 | 100 |
import timeit
import selenium.webdriver
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import time
import pandas as pd
driver_path = 'msedgedriver.exe'
constituents_url = 'https://www.stoxx.com/index-details?symbol=SXXP'
table_id = "stoxx_index_detail_component"
constituents = {}
driver = webdriver.Edge(driver_path)
driver.get(url=constituents_url)
components = driver.find_element_by_link_text('Components')
components.click()
driver.implicitly_wait(2)
table = driver.find_element_by_id('component-table')
for row in table.find_elements_by_xpath(".//tr"):
try:
href = row.find_element_by_xpath("./td[1]/input")
constituents[row.text] = href.get_property('value')
except:
# TODO: Add Logger
continue
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="onetrust-accept-btn-handler"]'))).click()
button_list = driver.find_elements_by_xpath("//*/li[contains(@onclick,'paginate')]")
counter = len(button_list)
driver.implicitly_wait(2)
idx = 0
while idx < counter:
print("Loading page {0}".format(idx))
button_list = driver.find_elements_by_xpath("//*/li[contains(@onclick,'paginate')]")
button_list[idx].click()
time.sleep(2)
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID,'component-table')))
table = driver.find_element_by_id('component-table')
rows = table.find_elements_by_xpath(".//tr")
print(len(rows))
for row in rows:
driver.implicitly_wait(2)
try:
href = row.find_element_by_xpath("./td[1]/input")
constituents[row.text] = href.get_property('value')
except Exception as err:
print("Issue: {0}".format(err))# TODO: Add Logger
driver.implicitly_wait(2)
continue
idx = idx+1
href = constituents.popitem()[1]
driver.get(href)
table = driver.find_element_by_class_name('flat-table')
static_data = table.text.split('\n')
output = []
for key_value in static_data:
key, value = key_value.split(': ', 1)
if not output or key in output[-1]:
output.append({})
output[-1][key] = value | [
11748,
640,
270,
198,
198,
11748,
384,
11925,
1505,
13,
12384,
26230,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
17077,
1330,
5313,
32103,
21321,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
13083,
1330,
26363,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
1330,
2938,
62,
17561,
1756,
355,
13182,
198,
11748,
640,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
26230,
62,
6978,
796,
705,
907,
48916,
38291,
13,
13499,
6,
198,
198,
9979,
34272,
658,
62,
6371,
796,
705,
5450,
1378,
2503,
13,
301,
1140,
87,
13,
785,
14,
9630,
12,
36604,
30,
1837,
23650,
28,
50,
8051,
47,
6,
198,
198,
11487,
62,
312,
796,
366,
301,
1140,
87,
62,
9630,
62,
49170,
62,
42895,
1,
198,
198,
9979,
34272,
658,
796,
23884,
198,
198,
26230,
796,
3992,
26230,
13,
37021,
7,
26230,
62,
6978,
8,
198,
26230,
13,
1136,
7,
6371,
28,
9979,
34272,
658,
62,
6371,
8,
198,
198,
5589,
3906,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
8726,
62,
5239,
10786,
7293,
3906,
11537,
198,
5589,
3906,
13,
12976,
3419,
198,
198,
26230,
13,
23928,
3628,
306,
62,
17077,
7,
17,
8,
198,
198,
11487,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
312,
10786,
42895,
12,
11487,
11537,
198,
1640,
5752,
287,
3084,
13,
19796,
62,
68,
3639,
62,
1525,
62,
87,
6978,
7,
1911,
1003,
2213,
1,
2599,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
13291,
796,
5752,
13,
19796,
62,
30854,
62,
1525,
62,
87,
6978,
7,
1911,
14,
8671,
58,
16,
60,
14,
15414,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
22573,
58,
808,
13,
5239,
60,
796,
13291,
13,
1136,
62,
26745,
10786,
8367,
11537,
198,
220,
220,
220,
2845,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1303,
16926,
46,
25,
3060,
5972,
1362,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
198,
13908,
32103,
21321,
7,
26230,
11,
838,
737,
28446,
7,
2943,
13,
30854,
62,
1462,
62,
1350,
62,
12976,
540,
19510,
3886,
13,
27481,
12599,
4032,
1003,
9,
58,
31,
312,
2625,
36823,
11469,
12,
13635,
12,
46118,
12,
30281,
8973,
6,
4008,
737,
12976,
3419,
198,
198,
16539,
62,
4868,
796,
4639,
13,
19796,
62,
68,
3639,
62,
1525,
62,
87,
6978,
7203,
1003,
16208,
4528,
58,
3642,
1299,
7,
31,
261,
12976,
4032,
79,
363,
4559,
11537,
60,
4943,
198,
24588,
796,
18896,
7,
16539,
62,
4868,
8,
198,
26230,
13,
23928,
3628,
306,
62,
17077,
7,
17,
8,
198,
312,
87,
796,
657,
198,
4514,
4686,
87,
1279,
3753,
25,
198,
220,
220,
220,
3601,
7203,
19031,
2443,
1391,
15,
92,
1911,
18982,
7,
312,
87,
4008,
628,
220,
220,
220,
4936,
62,
4868,
796,
4639,
13,
19796,
62,
68,
3639,
62,
1525,
62,
87,
6978,
7203,
1003,
16208,
4528,
58,
3642,
1299,
7,
31,
261,
12976,
4032,
79,
363,
4559,
11537,
60,
4943,
198,
220,
220,
220,
4936,
62,
4868,
58,
312,
87,
4083,
12976,
3419,
628,
220,
220,
220,
640,
13,
42832,
7,
17,
8,
628,
220,
220,
220,
5313,
32103,
21321,
7,
26230,
11,
838,
737,
28446,
7,
2943,
13,
18302,
594,
62,
1659,
62,
30854,
62,
75,
10533,
19510,
3886,
13,
2389,
4032,
42895,
12,
11487,
6,
22305,
198,
220,
220,
220,
3084,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
312,
10786,
42895,
12,
11487,
11537,
198,
220,
220,
220,
15274,
796,
3084,
13,
19796,
62,
68,
3639,
62,
1525,
62,
87,
6978,
7,
1911,
1003,
2213,
4943,
628,
220,
220,
220,
3601,
7,
11925,
7,
8516,
4008,
198,
220,
220,
220,
329,
5752,
287,
15274,
25,
198,
220,
220,
220,
220,
220,
220,
220,
4639,
13,
23928,
3628,
306,
62,
17077,
7,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13291,
796,
5752,
13,
19796,
62,
30854,
62,
1525,
62,
87,
6978,
7,
1911,
14,
8671,
58,
16,
60,
14,
15414,
4943,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22573,
58,
808,
13,
5239,
60,
796,
13291,
13,
1136,
62,
26745,
10786,
8367,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
2845,
35528,
355,
11454,
25,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
45147,
25,
1391,
15,
92,
1911,
18982,
7,
8056,
4008,
2,
16926,
46,
25,
3060,
5972,
1362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4639,
13,
23928,
3628,
306,
62,
17077,
7,
17,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2555,
628,
220,
220,
220,
4686,
87,
796,
4686,
87,
10,
16,
198,
198,
33257,
796,
22573,
13,
12924,
9186,
3419,
58,
16,
60,
198,
26230,
13,
1136,
7,
33257,
8,
198,
11487,
796,
4639,
13,
19796,
62,
30854,
62,
1525,
62,
4871,
62,
3672,
10786,
38568,
12,
11487,
11537,
198,
12708,
62,
7890,
796,
3084,
13,
5239,
13,
35312,
10786,
59,
77,
11537,
198,
198,
22915,
796,
17635,
198,
1640,
1994,
62,
8367,
287,
9037,
62,
7890,
25,
198,
220,
220,
220,
1994,
11,
1988,
796,
1994,
62,
8367,
13,
35312,
7,
10354,
46083,
352,
8,
198,
220,
220,
220,
611,
407,
5072,
393,
1994,
287,
5072,
58,
12,
16,
5974,
198,
220,
220,
220,
220,
220,
220,
220,
5072,
13,
33295,
15090,
30072,
198,
220,
220,
220,
5072,
58,
12,
16,
7131,
2539,
60,
796,
1988
] | 2.470339 | 944 |
import sys
import logging
import time
import tensorflow as tf
tf.compat.v1.enable_v2_behavior()
from tf_agents.drivers import dynamic_step_driver
from tf_agents.drivers import dynamic_episode_driver
from modules.runtime.commons.parameters import ParameterServer
from tf_agents.metrics import tf_metrics
from tf_agents.eval import metric_utils
from tf_agents.utils import common
from tf_agents.trajectories import time_step as ts
from src.runners.base_runner import BaseRunner
logger = logging.getLogger()
# NOTE(@hart): this will print all statements
# logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
class TFARunner(BaseRunner):
"""Runner that takes the runtime and agent
and runs the training and evaluation as specified.
"""
def get_initial_collection_driver(self):
"""Sets the initial collection driver for tf-agents.
"""
self._initial_collection_driver = []
for agent in self._agent:
self._initial_collection_driver.append(dynamic_episode_driver.DynamicEpisodeDriver(
env=self._runtime,
policy=agent._agent.collect_policy,
observers=[agent._replay_buffer.add_batch],
num_episodes=self._params["ML"]["Runner"]["initial_collection_steps"]))
def get_collection_driver(self):
"""Sets the collection driver for tf-agents.
"""
self._collection_driver = []
for agent in self._agent:
self._collection_driver.append(dynamic_step_driver.DynamicStepDriver(
env=self._runtime,
policy=agent._agent.collect_policy, # this is the agents policy
observers=[agent._replay_buffer.add_batch],
num_steps = 1
))
def collect_initial_episodes(self):
"""Function that collects the initial episodes
"""
for i in range(len(self._initial_collection_driver)):
self._initial_collection_driver[i].run()
def train(self):
"""Wrapper that sets the summary writer.
This enables a seamingless integration with TensorBoard.
"""
# collect initial episodes
self.collect_initial_episodes()
# main training cycle
if self._summary_writer is not None:
with self._summary_writer.as_default():
self._train()
else:
self._train()
def _train(self):
"""Trains the agent as specified in the parameter file
"""
pass
def evaluate(self):
"""Evaluates the agent
"""
global_iteration = self._agent._agent._train_step_counter.numpy()
logger.info("Evaluating the agent's performance in {} episodes."
.format(str(self._params["ML"]["Runner"]["evaluation_steps"])))
metric_utils.eager_compute(
self._eval_metrics,
self._runtime,
self._agent._agent.policy,
num_episodes=self._params["ML"]["Runner"]["evaluation_steps"])
metric_utils.log_metrics(self._eval_metrics)
tf.summary.scalar("mean_reward",
self._eval_metrics[0].result().numpy(),
step=global_iteration)
tf.summary.scalar("mean_steps",
self._eval_metrics[1].result().numpy(),
step=global_iteration)
logger.info(
"The agent achieved on average {} reward and {} steps in \
{} episodes." \
.format(str(self._eval_metrics[0].result().numpy()),
str(self._eval_metrics[1].result().numpy()),
str(self._params["ML"]["Runner"]["evaluation_steps"]))) | [
11748,
25064,
198,
11748,
18931,
198,
11748,
640,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
27110,
13,
5589,
265,
13,
85,
16,
13,
21633,
62,
85,
17,
62,
46571,
3419,
198,
198,
6738,
48700,
62,
49638,
13,
36702,
1330,
8925,
62,
9662,
62,
26230,
198,
6738,
48700,
62,
49638,
13,
36702,
1330,
8925,
62,
38668,
62,
26230,
198,
6738,
13103,
13,
43282,
13,
9503,
684,
13,
17143,
7307,
1330,
25139,
2357,
10697,
198,
198,
6738,
48700,
62,
49638,
13,
4164,
10466,
1330,
48700,
62,
4164,
10466,
198,
6738,
48700,
62,
49638,
13,
18206,
1330,
18663,
62,
26791,
198,
6738,
48700,
62,
49638,
13,
26791,
1330,
2219,
198,
6738,
48700,
62,
49638,
13,
9535,
752,
1749,
1330,
640,
62,
9662,
355,
40379,
198,
198,
6738,
12351,
13,
36740,
13,
8692,
62,
16737,
1330,
7308,
49493,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
3419,
198,
2,
24550,
7,
31,
18647,
2599,
428,
481,
3601,
477,
6299,
198,
2,
18931,
13,
35487,
16934,
7,
5532,
28,
17597,
13,
19282,
448,
11,
1241,
28,
6404,
2667,
13,
30531,
8,
198,
198,
4871,
24958,
1503,
403,
1008,
7,
14881,
49493,
2599,
198,
220,
37227,
49493,
326,
2753,
262,
19124,
290,
5797,
198,
220,
220,
220,
220,
290,
4539,
262,
3047,
290,
12660,
355,
7368,
13,
198,
220,
37227,
628,
220,
825,
651,
62,
36733,
62,
43681,
62,
26230,
7,
944,
2599,
198,
220,
220,
220,
37227,
50,
1039,
262,
4238,
4947,
4639,
329,
48700,
12,
49638,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2116,
13557,
36733,
62,
43681,
62,
26230,
796,
17635,
198,
220,
220,
220,
329,
5797,
287,
2116,
13557,
25781,
25,
198,
220,
220,
220,
220,
220,
2116,
13557,
36733,
62,
43681,
62,
26230,
13,
33295,
7,
67,
28995,
62,
38668,
62,
26230,
13,
44090,
23758,
32103,
7,
198,
220,
220,
220,
220,
220,
220,
220,
17365,
28,
944,
13557,
43282,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2450,
28,
25781,
13557,
25781,
13,
33327,
62,
30586,
11,
198,
220,
220,
220,
220,
220,
220,
220,
17984,
41888,
25781,
13557,
260,
1759,
62,
22252,
13,
2860,
62,
43501,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
997,
62,
538,
8052,
28,
944,
13557,
37266,
14692,
5805,
1,
7131,
1,
49493,
1,
7131,
1,
36733,
62,
43681,
62,
20214,
8973,
4008,
628,
220,
825,
651,
62,
43681,
62,
26230,
7,
944,
2599,
198,
220,
220,
220,
37227,
50,
1039,
262,
4947,
4639,
329,
48700,
12,
49638,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2116,
13557,
43681,
62,
26230,
796,
17635,
198,
220,
220,
220,
329,
5797,
287,
2116,
13557,
25781,
25,
198,
220,
220,
220,
220,
220,
2116,
13557,
43681,
62,
26230,
13,
33295,
7,
67,
28995,
62,
9662,
62,
26230,
13,
44090,
8600,
32103,
7,
198,
220,
220,
220,
220,
220,
220,
220,
17365,
28,
944,
13557,
43282,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2450,
28,
25781,
13557,
25781,
13,
33327,
62,
30586,
11,
1303,
428,
318,
262,
6554,
2450,
198,
220,
220,
220,
220,
220,
220,
220,
17984,
41888,
25781,
13557,
260,
1759,
62,
22252,
13,
2860,
62,
43501,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
997,
62,
20214,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
15306,
628,
220,
825,
2824,
62,
36733,
62,
538,
8052,
7,
944,
2599,
198,
220,
220,
220,
37227,
22203,
326,
26609,
262,
4238,
8640,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
329,
1312,
287,
2837,
7,
11925,
7,
944,
13557,
36733,
62,
43681,
62,
26230,
8,
2599,
198,
220,
220,
220,
220,
220,
2116,
13557,
36733,
62,
43681,
62,
26230,
58,
72,
4083,
5143,
3419,
628,
220,
825,
4512,
7,
944,
2599,
198,
220,
220,
220,
37227,
36918,
2848,
326,
5621,
262,
10638,
6260,
13,
198,
220,
220,
220,
220,
220,
220,
770,
13536,
257,
384,
3723,
1203,
11812,
351,
309,
22854,
29828,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1303,
2824,
4238,
8640,
198,
220,
220,
220,
2116,
13,
33327,
62,
36733,
62,
538,
8052,
3419,
198,
220,
220,
220,
1303,
1388,
3047,
6772,
198,
220,
220,
220,
611,
2116,
13557,
49736,
62,
16002,
318,
407,
6045,
25,
198,
220,
220,
220,
220,
220,
351,
2116,
13557,
49736,
62,
16002,
13,
292,
62,
12286,
33529,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
27432,
3419,
198,
220,
220,
220,
2073,
25,
198,
220,
220,
220,
220,
220,
2116,
13557,
27432,
3419,
628,
220,
825,
4808,
27432,
7,
944,
2599,
198,
220,
220,
220,
37227,
2898,
1299,
262,
5797,
355,
7368,
287,
262,
11507,
2393,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1208,
628,
220,
825,
13446,
7,
944,
2599,
198,
220,
220,
220,
37227,
36,
2100,
12632,
262,
5797,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3298,
62,
2676,
341,
796,
2116,
13557,
25781,
13557,
25781,
13557,
27432,
62,
9662,
62,
24588,
13,
77,
32152,
3419,
198,
220,
220,
220,
49706,
13,
10951,
7203,
36,
2100,
11927,
262,
5797,
338,
2854,
287,
23884,
8640,
526,
198,
220,
220,
220,
220,
220,
764,
18982,
7,
2536,
7,
944,
13557,
37266,
14692,
5805,
1,
7131,
1,
49493,
1,
7131,
1,
18206,
2288,
62,
20214,
8973,
22305,
198,
220,
220,
220,
18663,
62,
26791,
13,
68,
3536,
62,
5589,
1133,
7,
198,
220,
220,
220,
220,
220,
2116,
13557,
18206,
62,
4164,
10466,
11,
198,
220,
220,
220,
220,
220,
2116,
13557,
43282,
11,
198,
220,
220,
220,
220,
220,
2116,
13557,
25781,
13557,
25781,
13,
30586,
11,
198,
220,
220,
220,
220,
220,
997,
62,
538,
8052,
28,
944,
13557,
37266,
14692,
5805,
1,
7131,
1,
49493,
1,
7131,
1,
18206,
2288,
62,
20214,
8973,
8,
198,
220,
220,
220,
18663,
62,
26791,
13,
6404,
62,
4164,
10466,
7,
944,
13557,
18206,
62,
4164,
10466,
8,
198,
220,
220,
220,
48700,
13,
49736,
13,
1416,
282,
283,
7203,
32604,
62,
260,
904,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
18206,
62,
4164,
10466,
58,
15,
4083,
20274,
22446,
77,
32152,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2239,
28,
20541,
62,
2676,
341,
8,
198,
220,
220,
220,
48700,
13,
49736,
13,
1416,
282,
283,
7203,
32604,
62,
20214,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13557,
18206,
62,
4164,
10466,
58,
16,
4083,
20274,
22446,
77,
32152,
22784,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2239,
28,
20541,
62,
2676,
341,
8,
198,
220,
220,
220,
49706,
13,
10951,
7,
198,
220,
220,
220,
220,
220,
366,
464,
5797,
8793,
319,
2811,
23884,
6721,
290,
23884,
4831,
287,
3467,
198,
220,
220,
220,
220,
220,
23884,
8640,
526,
3467,
198,
220,
220,
220,
220,
220,
764,
18982,
7,
2536,
7,
944,
13557,
18206,
62,
4164,
10466,
58,
15,
4083,
20274,
22446,
77,
32152,
3419,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
965,
7,
944,
13557,
18206,
62,
4164,
10466,
58,
16,
4083,
20274,
22446,
77,
32152,
3419,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
965,
7,
944,
13557,
37266,
14692,
5805,
1,
7131,
1,
49493,
1,
7131,
1,
18206,
2288,
62,
20214,
8973,
22305
] | 2.683835 | 1,262 |
#!/usr/bin/env python
from setuptools import setup, find_packages
import versioneer
INSTALL_REQUIRES = open("requirements.txt").readlines()
setup(
name="lagtraj",
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="Python trajectory code for Lagrangian simulations",
url="https://github.com/EUREC4A-UK/lagtraj",
maintainer="Leif Denby",
maintainer_email="[email protected]",
py_modules=["lagtraj"],
packages=find_packages(),
package_data={"": ["*.csv", "*.yml", "*.html", "*.dat", "*.yaml"]},
include_package_data=True,
install_requires=INSTALL_REQUIRES,
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
zip_safe=False,
)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
11748,
2196,
28153,
198,
198,
38604,
7036,
62,
2200,
10917,
4663,
1546,
796,
1280,
7203,
8897,
18883,
13,
14116,
11074,
961,
6615,
3419,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
30909,
9535,
73,
1600,
198,
220,
220,
220,
2196,
28,
690,
7935,
263,
13,
1136,
62,
9641,
22784,
198,
220,
220,
220,
23991,
4871,
28,
690,
7935,
263,
13,
1136,
62,
28758,
4871,
22784,
198,
220,
220,
220,
6764,
2625,
37906,
22942,
2438,
329,
21003,
36985,
666,
27785,
1600,
198,
220,
220,
220,
19016,
2625,
5450,
1378,
12567,
13,
785,
14,
36,
11335,
34,
19,
32,
12,
15039,
14,
30909,
9535,
73,
1600,
198,
220,
220,
220,
5529,
263,
2625,
3123,
361,
5601,
1525,
1600,
198,
220,
220,
220,
5529,
263,
62,
12888,
2625,
75,
13,
66,
13,
6559,
1525,
31,
293,
5379,
13,
330,
13,
2724,
1600,
198,
220,
220,
220,
12972,
62,
18170,
28,
14692,
30909,
9535,
73,
33116,
198,
220,
220,
220,
10392,
28,
19796,
62,
43789,
22784,
198,
220,
220,
220,
5301,
62,
7890,
28,
4895,
1298,
14631,
24620,
40664,
1600,
366,
24620,
88,
4029,
1600,
366,
24620,
6494,
1600,
366,
24620,
19608,
1600,
366,
24620,
88,
43695,
8973,
5512,
198,
220,
220,
220,
2291,
62,
26495,
62,
7890,
28,
17821,
11,
198,
220,
220,
220,
2721,
62,
47911,
28,
38604,
7036,
62,
2200,
10917,
4663,
1546,
11,
198,
220,
220,
220,
890,
62,
11213,
28,
9654,
7203,
15675,
11682,
13,
9132,
11074,
961,
22784,
198,
220,
220,
220,
890,
62,
11213,
62,
11299,
62,
4906,
2625,
5239,
14,
4102,
2902,
1600,
198,
220,
220,
220,
19974,
62,
21230,
28,
25101,
11,
198,
8,
198
] | 2.60274 | 292 |
#executar um audio mp3
import pygame
pygame.init()
pygame.mixer.music.load('BlackDog.mp3')
pygame.mixer.music.play()
pygame.event.wait()
| [
2,
18558,
315,
283,
23781,
6597,
29034,
18,
198,
198,
11748,
12972,
6057,
198,
9078,
6057,
13,
15003,
3419,
198,
9078,
6057,
13,
19816,
263,
13,
28965,
13,
2220,
10786,
9915,
32942,
13,
3149,
18,
11537,
198,
9078,
6057,
13,
19816,
263,
13,
28965,
13,
1759,
3419,
198,
9078,
6057,
13,
15596,
13,
17077,
3419,
198
] | 2.464286 | 56 |
from dataclasses import dataclass
from bindings.gmd.geometric_complex_type import GeometricComplexType
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
34111,
13,
70,
9132,
13,
469,
16996,
62,
41887,
62,
4906,
1330,
2269,
16996,
5377,
11141,
6030,
198,
198,
834,
45,
29559,
47,
11598,
834,
796,
366,
4023,
1378,
2503,
13,
404,
1516,
271,
13,
3262,
14,
70,
4029,
1,
628,
198,
31,
19608,
330,
31172,
198
] | 2.842105 | 57 |
from .base import registered_device_types # noqa
from .kettle_redmond import RedmondKettle # noqa
from .xiaomi_ht import XiaomiHumidityTemperatureV1 # noqa
from .xiaomi_lywsd03 import XiaomiHumidityTemperatureLYWSD # noqa
| [
6738,
764,
8692,
1330,
6823,
62,
25202,
62,
19199,
220,
1303,
645,
20402,
198,
6738,
764,
74,
23570,
62,
445,
6327,
1330,
49420,
42,
23570,
220,
1303,
645,
20402,
198,
6738,
764,
36072,
12753,
62,
4352,
1330,
46726,
32661,
17995,
42492,
53,
16,
220,
1303,
645,
20402,
198,
6738,
764,
36072,
12753,
62,
306,
18504,
67,
3070,
1330,
46726,
32661,
17995,
42492,
11319,
54,
10305,
220,
1303,
645,
20402,
198
] | 3.228571 | 70 |
import sys, getopt, subprocess
from src.common.load_h5 import H5COUNTS
from src.preprocess.build_h5_GSE103224 import build_h5
import pandas as pd
# # Load data
# scRNAdata = H5COUNTS('data/GSE103224.h5')
# # Preprocess data
# scRNAdata.preprocess_data(log_normalize=True, filter_genes=False, n_neighbors=False, umap=False)
# # Add clustering results
# scRNAdata.add_clustering_results(path='data/interim/', tumor_ids=[1, 2, 3, 4, 5, 6, 7, 8])
#
# # Get a list of biomarkers associated to Glioma survival
# BIOMARKER_F = "data/glioma_survival_associated_genes_Fatai.csv"
# biomarkers_df = pd.read_table(BIOMARKER_F, )
# biomarkers = pd.Index(scRNAdata.GENE_NAMES) & biomarkers_df["Gene"].unique()
#
# # Aggregate all cell expressions to find clusters with the biomarkers expressed
# scRNAdata.get_aggregated_cluster_expression(biomarkers, quantile_threshold=0.75,)
#
# # Run GSEA on all the DE genes for each cluster
# from src.analysis.gsea_analysis import GSEA_Analysis
# gsea = GSEA_Analysis(scRNAdata, path='data/interim/', threshold=0.05,) # path leads the file with the DE genes list for each cluster
# gsea.get_gsea_result()
#
# # Get the GSEA results of only the clusters which have a query biomarker expressed
# query_biomarker = ["CDC6"]
# result = gsea.get_gsea_result_by_cluster(scRNAdata.get_clusters_with_biomarker_expression(query_biomarker))
#
# # Visualize
# from src.visualization import heatmap
# heatmap(result, height=1000, width=600)
if __name__== "__main__":
main(sys.argv[1:]) | [
11748,
25064,
11,
651,
8738,
11,
850,
14681,
198,
6738,
12351,
13,
11321,
13,
2220,
62,
71,
20,
1330,
367,
20,
34,
19385,
4694,
198,
6738,
12351,
13,
3866,
14681,
13,
11249,
62,
71,
20,
62,
38,
5188,
940,
2624,
1731,
1330,
1382,
62,
71,
20,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
1303,
8778,
1366,
198,
2,
629,
42336,
2782,
1045,
796,
367,
20,
34,
19385,
4694,
10786,
7890,
14,
38,
5188,
940,
2624,
1731,
13,
71,
20,
11537,
198,
2,
1303,
3771,
14681,
1366,
198,
2,
629,
42336,
2782,
1045,
13,
3866,
14681,
62,
7890,
7,
6404,
62,
11265,
1096,
28,
17821,
11,
8106,
62,
5235,
274,
28,
25101,
11,
299,
62,
710,
394,
32289,
28,
25101,
11,
334,
8899,
28,
25101,
8,
198,
2,
1303,
3060,
32966,
1586,
2482,
198,
2,
629,
42336,
2782,
1045,
13,
2860,
62,
565,
436,
1586,
62,
43420,
7,
6978,
11639,
7890,
14,
3849,
320,
14,
3256,
22359,
62,
2340,
41888,
16,
11,
362,
11,
513,
11,
604,
11,
642,
11,
718,
11,
767,
11,
807,
12962,
198,
2,
198,
2,
1303,
3497,
257,
1351,
286,
49951,
364,
3917,
284,
2671,
72,
6086,
9441,
198,
2,
20068,
2662,
14175,
1137,
62,
37,
796,
366,
7890,
14,
70,
4528,
6086,
62,
48846,
2473,
62,
32852,
62,
5235,
274,
62,
37,
1045,
72,
13,
40664,
1,
198,
2,
49951,
364,
62,
7568,
796,
279,
67,
13,
961,
62,
11487,
7,
3483,
2662,
14175,
1137,
62,
37,
11,
1267,
198,
2,
49951,
364,
796,
279,
67,
13,
15732,
7,
1416,
42336,
2782,
1045,
13,
35353,
36,
62,
45,
29559,
8,
1222,
49951,
364,
62,
7568,
14692,
39358,
1,
4083,
34642,
3419,
198,
2,
198,
2,
1303,
19015,
49373,
477,
2685,
14700,
284,
1064,
23163,
351,
262,
49951,
364,
6241,
198,
2,
629,
42336,
2782,
1045,
13,
1136,
62,
9460,
2301,
515,
62,
565,
5819,
62,
38011,
7,
8482,
296,
668,
364,
11,
5554,
576,
62,
400,
10126,
28,
15,
13,
2425,
35751,
198,
2,
198,
2,
1303,
5660,
402,
46887,
319,
477,
262,
5550,
10812,
329,
1123,
13946,
198,
2,
422,
12351,
13,
20930,
13,
70,
8583,
62,
20930,
1330,
402,
46887,
62,
32750,
198,
2,
308,
8583,
796,
402,
46887,
62,
32750,
7,
1416,
42336,
2782,
1045,
11,
3108,
11639,
7890,
14,
3849,
320,
14,
3256,
11387,
28,
15,
13,
2713,
35751,
1303,
3108,
5983,
262,
2393,
351,
262,
5550,
10812,
1351,
329,
1123,
13946,
198,
2,
308,
8583,
13,
1136,
62,
70,
8583,
62,
20274,
3419,
198,
2,
198,
2,
1303,
3497,
262,
402,
46887,
2482,
286,
691,
262,
23163,
543,
423,
257,
12405,
49951,
263,
6241,
198,
2,
12405,
62,
8482,
296,
668,
263,
796,
14631,
47667,
21,
8973,
198,
2,
1255,
796,
308,
8583,
13,
1136,
62,
70,
8583,
62,
20274,
62,
1525,
62,
565,
5819,
7,
1416,
42336,
2782,
1045,
13,
1136,
62,
565,
13654,
62,
4480,
62,
8482,
296,
668,
263,
62,
38011,
7,
22766,
62,
8482,
296,
668,
263,
4008,
198,
2,
198,
2,
1303,
15612,
1096,
198,
2,
422,
12351,
13,
41464,
1634,
1330,
4894,
8899,
198,
2,
4894,
8899,
7,
20274,
11,
6001,
28,
12825,
11,
9647,
28,
8054,
8,
628,
198,
198,
361,
11593,
3672,
834,
855,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
7,
17597,
13,
853,
85,
58,
16,
25,
12962
] | 2.720217 | 554 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.