def encode_z1(self, input: Tensor, z2: Tensor) -> List[Tensor]:
        x = self.embed_data(input)
        z2 = self.embed_z2_code(z2)
        z2 = z2.view(-1, self.img_size, self.img_size).unsqueeze(1)
        result = torch.cat([x, z2], dim=1)

        result = self.encoder_z1_layers(result)
        result = torch.flatten(result, start_dim=1)
        z1_mu = self.fc_z1_mu(result)
        z1_log_var = self.fc_z1_var(result)

        return [z1_mu, z1_log_var]

encode_z1(self=HVAE(  (encoder_z2_layers): Sequential(    (0): Sequential(      (0): Conv2d(3, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (1): Sequential(      (0): Conv2d(32, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (2): Sequential(      (0): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (3): Sequential(      (0): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (4): Sequential(      (0): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )  )  (fc_z2_mu): Linear(in_features=2048, out_features=20, bias=True)  (fc_z2_var): Linear(in_features=2048, out_features=20, bias=True)  (embed_z2_code): Linear(in_features=20, out_features=4096, bias=True)  (embed_data): Conv2d(3, 3, kernel_size=(1, 1), stride=(1, 1))  (encoder_z1_layers): Sequential(    (0): Sequential(      (0): Conv2d(4, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (1): Sequential(      (0): Conv2d(32, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (2): Sequential(      (0): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (3): Sequential(      (0): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (4): Sequential(      (0): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))      (1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )  )  (fc_z1_mu): Linear(in_features=2048, out_features=10, bias=True)  (fc_z1_var): Linear(in_features=2048, out_features=10, bias=True)  (recons_z1_mu): Linear(in_features=20, out_features=10, bias=True)  (recons_z1_log_var): Linear(in_features=20, out_features=10, bias=True)  (debed_z1_code): Linear(in_features=10, out_features=1024, bias=True)  (debed_z2_code): Linear(in_features=20, out_features=1024, bias=True)  (decoder): Sequential(    (0): Sequential(      (0): ConvTranspose2d(512, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))      (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (1): Sequential(      (0): ConvTranspose2d(256, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))      (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (2): Sequential(      (0): ConvTranspose2d(128, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))      (1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )    (3): Sequential(      (0): ConvTranspose2d(64, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))      (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)      (2): LeakyReLU(negative_slope=0.01)    )  )  (final_layer): Sequential(    (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))    (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)    (3): Conv2d(32, 3, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))    (4): Tanh()  )), input=tensor([[[[-1.8936,  0.4196,  1.2842,  ...,  1.2066,  0.7782,  1.3469],          [-0.8224,  0.4527, -0.0577,  ...,  1.4756,  1.1761, -0.7108],          [-1.6315,  0.8043,  2.6413,  ..., -1.3240,  0.9065, -0.8693],          ...,          [ 0.0383,  1.3328, -0.1353,  ..., -1.1770, -0.1116, -0.3206],          [-1.0151,  0.2528, -0.3343,  ..., -0.0416, -0.9868,  1.1128],          [-1.0028, -1.1892,  0.7485,  ...,  0.7481,  0.0498, -0.0744]],         [[-0.2884, -0.2759,  1.1363,  ...,  1.1605,  0.0775, -1.4702],          [-1.6069, -0.0638, -0.8533,  ...,  0.2473,  1.4863,  0.0158],          [ 2.5342,  0.6854,  1.1528,  ...,  0.6568, -0.5946,  0.1834],          ...,          [ 0.3353,  0.0865, -0.9538,  ..., -1.2018, -1.4665, -0.3575],          [-0.3430, -1.4583, -0.7826,  ...,  2.1256, -0.3949,  0.1570],          [ 0.9678, -1.7589,  0.9122,  ...,  0.4558,  1.4173,  1.6013]],         [[-0.7772,  0.4630,  0.6564,  ..., -1.8964, -2.1647, -0.5534],          [ 0.4105,  0.5011,  1.2573,  ...,  0.3236,  0.9842,  1.0977],          [-0.7429,  1.0571,  0.6543,  ...,  0.3400, -0.2293, -0.5091],          ...,          [ 0.1505, -0.3082,  0.3324,  ...,  0.6619, -0.0814,  0.6934],          [-1.7772, -1.9982,  0.5367,  ...,  0.1102, -0.7138,  0.8455],          [ 0.0332, -0.3734, -1.5362,  ..., -1.2318, -0.4791, -1.6185]]],        [[[ 0.0160,  0.7455,  0.3158,  ..., -0.0860,  0.2626,  1.1479],          [-0.4146,  1.8953,  0.0897,  ..., -0.3885,  1.2116, -1.0973],          [-0.6872, -1.8162,  0.1554,  ..., -1.7179,  1.0908,  0.8081],          ...,          [ 0.1696, -1.8558,  0.1469,  ...,  0.3142,  2.3475,  0.4731],          [ 0.1529, -1.0062,  0.7995,  ...,  0.2377,  0.8177,  0.9386],          [ 0.0217, -0.4921, -0.8103,  ...,  2.6341, -0.5868, -0.0105]],         [[ 1.4296,  0.8156, -0.1442,  ..., -1.5969,  0.2655,  1.3892],          [ 0.0990, -0.1513, -0.2613,  ..., -0.5251, -0.1855, -0.1718],          [ 1.4328,  0.2132, -1.6794,  ...,  0.8488,  1.4868, -1.7160],          ...,          [-0.0693,  0.1337,  1.1090,  ..., -1.3724, -2.5672,  1.0906],          [ 0.2655,  0.3716, -0.1245,  ...,  0.7961, -0.3946,  1.0061],          [-0.8810,  0.1413, -0.6222,  ..., -0.4905, -0.3606, -1.0626]],         [[-0.0948, -0.0486,  0.0157,  ...,  2.1004, -1.5879, -0.2739],          [-0.2656,  1.1246,  1.0048,  ...,  0.4671, -0.1705, -0.7745],          [-0.3759,  0.2029, -1.7732,  ..., -0.2653, -2.3626, -1.0251],          ...,          [ 1.4900, -1.3544,  1.5717,  ..., -1.9406,  0.7142, -0.6601],          [ 0.0120,  0.9058,  0.0421,  ...,  1.5632,  1.1624,  0.1822],          [-0.9256,  0.8344, -0.9597,  ..., -0.4188,  0.2051,  0.6043]]],        [[[-0.6292,  1.5933,  1.1558,  ..., -1.0939,  0.3556, -1.9305],          [ 2.2168,  0.9184, -0.6098,  ...,  0.1250,  0.2496,  0.5268],          [ 0.6035, -0.7713,  0.4179,  ...,  0.1061,  0.2763, -1.1580],          ...,          [ 0.6361, -0.9818,  0.2838,  ..., -0.1032, -0.1063,  0.2971],          [-0.9087, -0.8842,  1.3305,  ...,  0.7932,  1.0652, -0.1426],          [-2.2427, -0.6605,  0.9667,  ..., -0.4021, -1.1495, -0.0572]],         [[-0.1344,  0.6562,  0.4687,  ...,  0.1312,  0.5327,  0.3450],          [ 0.4334,  1.3153,  1.9282,  ...,  0.5667,  1.4108,  0.4699],          [ 0.5254, -0.2920,  1.7819,  ..., -0.5157, -0.3931, -0.8093],          ...,          [-0.5848,  0.6157,  1.1588,  ...,  0.5449, -1.0721,  0.5217],          [ 0.3995,  0.2235,  0.2506,  ..., -0.3272,  0.8440,  0.4930],          [-0.8263, -0.0577, -0.9538,  ..., -1.2877,  1.6349,  1.3202]],         [[ 0.6381, -1.4398, -0.7744,  ...,  1.2140,  0.9096, -0.6753],          [ 0.4048, -2.5466,  1.1450,  ...,  0.5030,  0.4698,  0.5673],          [-0.0358,  0.2170, -0.6245,  ..., -0.4325,  0.5767, -0.2755],          ...,          [ 0.3158, -1.6521,  0.9919,  ...,  2.0221, -1.2303,  0.4039],          [ 0.2354, -0.9477, -0.6534,  ..., -0.5600, -1.3333,  0.5403],          [ 1.1120, -2.0893, -1.3755,  ...,  1.9954,  0.8662, -1.6815]]],        ...,        [[[ 1.2590,  0.1363, -0.6754,  ..., -0.8791,  1.2095, -0.1012],          [ 2.3050, -0.1425, -0.9242,  ..., -0.7649, -0.7488,  0.6949],          [ 0.4214,  0.3215, -2.3866,  ..., -0.5338,  0.4479, -0.8477],          ...,          [ 0.1499, -0.5690,  0.0180,  ...,  1.6823,  0.3056, -0.6216],          [-0.3886,  0.6260, -0.6109,  ...,  0.0346,  0.2253, -0.5103],          [-0.1228,  0.1755,  0.1834,  ..., -2.4334, -0.4735,  0.3909]],         [[-0.5463,  0.1758,  0.3594,  ..., -1.5349, -0.1570,  0.0686],          [-0.1374,  1.0209, -0.5383,  ..., -0.9182, -0.2435, -0.2757],          [ 0.6611, -0.2038, -1.1446,  ..., -1.4481,  0.6467, -0.6618],          ...,          [-0.2686,  0.0405, -0.1467,  ...,  1.0902,  0.5896, -0.7653],          [-1.9040,  0.0179,  1.1207,  ..., -0.2288, -1.6366,  1.1901],          [ 0.1832,  0.3417,  0.9626,  ...,  0.3803,  0.7350, -0.3099]],         [[-0.9969, -0.5508, -0.4998,  ...,  0.6936,  1.6136,  0.3220],          [-0.0770,  1.3169,  0.1651,  ...,  1.7485,  0.7226, -0.2574],          [ 0.0803, -0.9462,  1.2021,  ..., -0.0972,  0.0682,  0.1344],          ...,          [-1.7403,  1.7113,  3.0679,  ...,  1.0908,  1.0581, -0.5222],          [ 0.4028, -1.0059, -2.1630,  ..., -0.0682,  0.5164,  1.6635],          [ 2.7208, -0.5648, -0.1862,  ..., -1.5719, -0.3802,  0.2935]]],        [[[ 0.8409, -0.7438, -1.0032,  ...,  0.1318, -0.4320,  0.4415],          [ 1.5099, -1.1524,  1.1499,  ..., -1.6440, -0.0798,  0.6606],          [ 1.0045, -0.9537,  1.1316,  ..., -1.3674, -0.9758, -0.0078],          ...,          [ 0.3468,  0.5475, -0.7472,  ...,  1.5581,  0.2254,  0.8593],          [-0.0717,  0.4480,  1.3726,  ...,  0.6523, -1.1766, -0.3996],          [-1.6755, -0.8156,  0.5543,  ..., -1.4320,  0.4414, -0.1122]],         [[ 1.3380, -1.1875,  0.5178,  ...,  0.3197, -0.7422,  0.5158],          [-1.1908,  1.4007,  0.8123,  ..., -1.4919, -1.7273, -0.0800],          [-1.3901, -0.3755,  0.0897,  ...,  1.6764, -1.3049, -0.0079],          ...,          [-0.1568, -1.4188, -0.7429,  ..., -1.6218,  0.6604,  1.6529],          [ 0.6247,  0.6867, -1.0114,  ..., -0.0381,  0.1275, -0.8645],          [-0.0610,  0.5389,  0.3990,  ..., -1.0361, -2.4215, -0.6971]],         [[ 0.7516, -1.9676,  1.4015,  ...,  0.5336,  1.0704,  1.7422],          [-1.6988, -1.2900, -0.6327,  ..., -0.9592,  1.5238,  0.2264],          [ 1.0729,  0.8629, -0.5775,  ..., -0.7702, -0.0271,  0.7063],          ...,          [ 0.4322,  1.7422,  0.5302,  ...,  1.7000,  1.1956,  0.4742],          [ 0.4945,  0.2216, -1.3425,  ..., -0.9851,  0.1730,  1.0625],          [-0.6886, -0.1384, -0.4764,  ...,  0.3615,  0.5811,  0.4600]]],        [[[-0.8843,  0.8162, -0.5182,  ...,  0.3598, -0.5506, -0.5101],          [-0.4878, -1.6419, -0.5060,  ...,  1.8825, -0.1327,  0.3133],          [ 0.4729,  0.4339,  1.0820,  ..., -1.3299, -0.7871, -0.6630],          ...,          [-1.1407,  0.0937,  1.0086,  ...,  0.2854,  0.4308,  1.1841],          [ 0.3772, -0.8250,  1.1873,  ...,  0.1146, -0.7267,  0.4953],          [-0.3229, -1.0868, -0.0125,  ..., -0.6451,  1.2862, -1.9553]],         [[-0.4689, -0.3666, -0.3470,  ..., -0.0699, -1.9161, -0.4589],          [-0.4437,  0.9324, -2.2532,  ...,  0.1354,  1.1196, -0.0070],          [ 1.1838,  0.3169,  1.2460,  ..., -0.9694,  0.3669,  0.7385],          ...,          [-1.7229,  0.6705,  0.0683,  ...,  1.0143,  0.6204, -1.1060],          [ 0.2528, -2.3181, -0.0774,  ..., -0.3610,  0.4452, -0.3837],          [-1.2532, -0.3006,  0.6067,  ..., -0.8430, -0.5149,  0.8442]],         [[-1.8861, -0.4756,  0.9849,  ...,  0.7845, -0.8080, -0.6442],          [-0.7163,  0.8101, -0.1905,  ...,  0.3361,  0.6133, -0.1919],          [-0.7476, -0.5810, -0.1615,  ..., -0.5631,  0.0637, -0.1969],          ...,          [-0.9449, -0.9001,  1.0701,  ...,  0.4150,  0.1768, -0.4086],          [ 0.5126,  1.4135,  1.6389,  ..., -0.6361, -0.3524, -0.2547],          [ 0.0541, -1.5909, -1.5796,  ..., -0.1662, -0.7188, -0.6655]]]]), z2=tensor([[-1.2900e+00, -1.9974e+00, -1.2873e+00,  6.8312e-01,  1.1999e+00,          5.2038e-01, -1.1960e+00,  5.8112e-01,  1.0388e-01, -1.2854e-01,          4.6986e-01,  4.9946e-01,  7.0090e-01,  3.2990e-01,  6.1682e-01,          4.5016e-01,  6.5489e-01, -3.5582e-01, -5.0099e-01,  8.5103e-01],        [-6.6771e-01, -1.3980e+00, -4.8212e-01, -2.3246e-01,  5.8675e-01,         -4.5213e-01, -5.7778e-02, -9.8022e-02, -2.0276e+00, -2.1314e+00,         -6.2125e-01,  1.7824e+00, -9.2441e-02, -5.5198e-01,  3.9835e-01,         -8.2421e-02,  4.7706e-01, -7.4640e-02, -9.8138e-01,  1.1754e+00],        [-1.9242e-01,  4.4564e-01, -1.7303e-01,  1.7473e+00, -1.4152e+00,          8.4109e-01, -1.9819e+00,  2.4425e+00,  7.1755e-01, -9.0582e-01,         -5.1756e-01,  1.8689e+00, -6.7044e-01, -1.3858e+00, -1.6933e-01,         -6.0295e-01, -3.1655e-01, -9.6165e-01,  1.0204e+00, -6.7928e-01],        [-9.2453e-01,  9.0098e-01,  4.8510e-01,  9.0699e-01, -7.1865e-01,          3.9064e-01, -1.9083e+00, -1.1505e+00,  7.4294e-01, -3.6578e-02,         -5.0377e-02, -1.4724e+00,  1.4315e+00, -1.1902e-01, -2.1044e-01,         -9.7274e-02,  1.4786e+00,  5.8825e-01,  2.4738e-01,  4.7886e-01],        [-5.2584e-01, -5.9981e-02,  9.6410e-02,  1.4674e-01, -2.5624e+00,         -1.2189e+00,  3.6519e-01,  1.9240e+00,  2.7167e+00, -8.9335e-01,         -8.4352e-01,  3.2160e-01,  2.1540e+00,  1.9824e+00,  9.2087e-01,          1.2441e-01, -3.8424e-01,  1.0510e+00, -1.6387e+00, -6.6610e-01],        [ 1.9033e-02, -8.3761e-01, -1.7144e+00, -2.1722e-01,  5.7782e-01,         -8.5884e-01,  1.5352e-01, -3.2194e-02,  1.7006e+00,  2.2611e-01,         -6.6798e-01,  4.2757e-01,  1.1844e+00, -8.2032e-01,  8.5881e-01,         -1.6389e+00, -1.1470e-01,  4.3548e-01, -4.9292e-01, -1.4239e+00],        [-1.8718e-03,  5.0300e-01,  9.4769e-01,  1.3772e-01,  1.2630e+00,          4.9913e-01, -1.8855e+00, -3.6696e-01, -2.0715e-01, -1.8160e-01,          2.6803e-01, -1.7591e-01, -1.1231e+00,  2.9996e-01,  3.0419e-01,          3.2485e-01, -7.8852e-01, -1.3825e+00,  1.5446e+00, -1.5957e+00],        [ 1.2224e+00,  5.4267e-02, -2.8773e-01, -7.6571e-01,  1.3390e-01,          6.8962e-01,  1.7844e-01, -3.5639e-01, -4.0127e-02, -9.6210e-01,         -5.4299e-01,  5.6972e-01,  1.4236e+00, -4.4062e-01,  1.2558e+00,          9.4424e-01,  7.9834e-01, -1.9353e+00,  2.2831e-02,  1.1698e+00],        [ 3.0282e-01,  4.6073e-01, -1.0822e+00, -3.9287e-01, -5.2540e-01,         -6.2057e-01, -1.0958e+00, -1.3846e-01,  9.9414e-01,  1.3613e+00,         -1.3443e+00,  4.5995e-01,  7.6624e-01, -1.8855e+00,  4.2138e-01,          8.1800e-02,  1.0457e+00, -1.3314e+00, -1.4370e+00, -2.2902e-02],        [-1.2029e+00, -4.5437e-01,  2.1817e-01,  5.0700e-01,  2.3848e-01,         -1.5998e+00,  3.1236e+00,  3.2451e-01,  1.0552e+00, -1.3499e-01,         -2.4435e+00,  6.1070e-01,  1.7400e+00, -8.0414e-01, -9.5173e-01,         -3.1292e-01,  2.3043e+00, -1.5358e+00, -1.0775e-01, -1.1630e+00],        [-1.1019e+00,  1.6819e+00, -4.5248e-01,  8.8460e-01, -1.1410e-01,         -1.0526e+00, -8.9691e-01,  4.4700e-01,  3.9597e-01, -8.3095e-01,         -2.4551e+00,  1.1435e-01, -2.9407e-01, -1.2293e+00, -2.8295e+00,         -3.0189e-01,  1.6674e-02, -1.5991e+00,  1.5892e-01, -4.5429e-01],        [ 1.5585e+00, -1.6472e-02, -1.7998e-01, -7.0806e-01, -1.9840e+00,         -5.5717e-01,  7.8396e-01,  4.3221e-01,  1.9304e-02, -8.3582e-01,          3.1031e-01, -4.0005e-01,  2.2043e-01,  4.4766e-01,  1.3857e-01,         -1.0083e+00,  5.1706e-02, -1.2183e+00, -1.8305e-01, -8.0962e-01],        [ 1.1933e+00, -1.9682e-01,  3.0758e-01, -9.4026e-01, -1.5966e-01,          1.2627e+00,  9.4436e-01,  2.0236e-01, -1.1885e+00,  6.8988e-01,         -1.0912e+00, -6.8157e-02,  1.9551e+00, -1.6896e+00, -2.6537e-01,         -1.5902e+00,  1.8715e-02, -1.7566e+00, -4.4485e-01, -2.9117e-01],        [-2.2808e+00, -1.3932e+00, -2.1048e-01, -2.3856e+00,  3.1914e-01,         -6.4313e-01, -8.6689e-01, -1.2414e+00, -9.7393e-01, -1.1433e+00,          1.5302e-01,  6.6312e-01, -1.9848e-01, -1.2353e+00,  2.5797e-01,         -6.6730e-01,  2.6706e-01, -2.6511e+00, -1.1872e+00, -1.0793e+00],        [-9.9676e-01,  4.2526e-01,  1.8178e+00, -9.1751e-03,  8.7009e-01,         -3.2026e-01, -1.0095e+00,  3.5825e-01,  8.4667e-01, -2.8318e-02,          4.1016e-01, -1.4537e+00,  3.3764e+00, -1.7832e+00, -1.0972e+00,          3.9235e-01,  4.3836e-01,  1.4538e-01, -1.1909e+00,  9.7822e-01],        [ 1.2616e+00, -1.4657e-01, -2.5914e+00, -7.2625e-01,  1.2653e+00,         -2.3051e+00,  1.6718e-01, -5.7320e-01, -2.1863e-01, -1.9877e+00,         -1.3305e+00, -1.1724e-01,  1.8090e+00, -5.3239e-01,  2.1936e-01,         -2.3490e+00, -1.7993e+00, -2.7736e+00, -2.0880e-01,  1.0949e+00]],       grad_fn=<AddBackward0>), self._backward_hooks=OrderedDict(), self._backward_pre_hooks=OrderedDict(), self._buffers=OrderedDict(), self._forward_hooks=OrderedDict(), self._forward_hooks_always_called=OrderedDict(), self._forward_hooks_with_kwargs=OrderedDict(), self._forward_pre_hooks=OrderedDict(), self._forward_pre_hooks_with_kwargs=OrderedDict(), self._is_full_backward_hook=None, self._load_state_dict_post_hooks=OrderedDict(), self._load_state_dict_pre_hooks=OrderedDict(), self._modules=OrderedDict([('encoder_z2_layers', Sequential(  (0): Sequential(    (0): Conv2d(3, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (1): Sequential(    (0): Conv2d(32, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (2): Sequential(    (0): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (3): Sequential(    (0): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (4): Sequential(    (0): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  ))), ('fc_z2_mu', Linear(in_features=2048, out_features=20, bias=True)), ('fc_z2_var', Linear(in_features=2048, out_features=20, bias=True)), ('embed_z2_code', Linear(in_features=20, out_features=4096, bias=True)), ('embed_data', Conv2d(3, 3, kernel_size=(1, 1), stride=(1, 1))), ('encoder_z1_layers', Sequential(  (0): Sequential(    (0): Conv2d(4, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (1): Sequential(    (0): Conv2d(32, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (2): Sequential(    (0): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (3): Sequential(    (0): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (4): Sequential(    (0): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))    (1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  ))), ('fc_z1_mu', Linear(in_features=2048, out_features=10, bias=True)), ('fc_z1_var', Linear(in_features=2048, out_features=10, bias=True)), ('recons_z1_mu', Linear(in_features=20, out_features=10, bias=True)), ('recons_z1_log_var', Linear(in_features=20, out_features=10, bias=True)), ('debed_z1_code', Linear(in_features=10, out_features=1024, bias=True)), ('debed_z2_code', Linear(in_features=20, out_features=1024, bias=True)), ('decoder', Sequential(  (0): Sequential(    (0): ConvTranspose2d(512, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))    (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (1): Sequential(    (0): ConvTranspose2d(256, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))    (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (2): Sequential(    (0): ConvTranspose2d(128, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))    (1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  )  (3): Sequential(    (0): ConvTranspose2d(64, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))    (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)    (2): LeakyReLU(negative_slope=0.01)  ))), ('final_layer', Sequential(  (0): ConvTranspose2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))  (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)  (2): LeakyReLU(negative_slope=0.01)  (3): Conv2d(32, 3, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))  (4): Tanh()))]), self._non_persistent_buffers_set=set(), self._parameters=OrderedDict(), self._state_dict_hooks=OrderedDict(), self._state_dict_pre_hooks=OrderedDict(), self.img_size=64, self.latent1_dim=10, self.latent2_dim=20, self.training=True)

Input: tensor([[[[-1.8936,  0.4196,  1.2842,  ...,  1.2066,  0.7782,  1.3469],          [-0.8224,  0.4527, -0.0577,  ...,  1.4756,  1.1761, -0.7108],          [-1.6315,  0.8043,  2.6413,  ..., -1.3240,  0.9065, -0.8693],          ...,          [ 0.0383,  1.3328, -0.1353,  ..., -1.1770, -0.1116, -0.3206],          [-1.0151,  0.2528, -0.3343,  ..., -0.0416, -0.9868,  1.1128],          [-1.0028, -1.1892,  0.7485,  ...,  0.7481,  0.0498, -0.0744]],         [[-0.2884, -0.2759,  1.1363,  ...,  1.1605,  0.0775, -1.4702],          [-1.6069, -0.0638, -0.8533,  ...,  0.2473,  1.4863,  0.0158],          [ 2.5342,  0.6854,  1.1528,  ...,  0.6568, -0.5946,  0.1834],          ...,          [ 0.3353,  0.0865, -0.9538,  ..., -1.2018, -1.4665, -0.3575],          [-0.3430, -1.4583, -0.7826,  ...,  2.1256, -0.3949,  0.1570],          [ 0.9678, -1.7589,  0.9122,  ...,  0.4558,  1.4173,  1.6013]],         [[-0.7772,  0.4630,  0.6564,  ..., -1.8964, -2.1647, -0.5534],          [ 0.4105,  0.5011,  1.2573,  ...,  0.3236,  0.9842,  1.0977],          [-0.7429,  1.0571,  0.6543,  ...,  0.3400, -0.2293, -0.5091],          ...,          [ 0.1505, -0.3082,  0.3324,  ...,  0.6619, -0.0814,  0.6934],          [-1.7772, -1.9982,  0.5367,  ...,  0.1102, -0.7138,  0.8455],          [ 0.0332, -0.3734, -1.5362,  ..., -1.2318, -0.4791, -1.6185]]],        [[[ 0.0160,  0.7455,  0.3158,  ..., -0.0860,  0.2626,  1.1479],          [-0.4146,  1.8953,  0.0897,  ..., -0.3885,  1.2116, -1.0973],          [-0.6872, -1.8162,  0.1554,  ..., -1.7179,  1.0908,  0.8081],          ...,          [ 0.1696, -1.8558,  0.1469,  ...,  0.3142,  2.3475,  0.4731],          [ 0.1529, -1.0062,  0.7995,  ...,  0.2377,  0.8177,  0.9386],          [ 0.0217, -0.4921, -0.8103,  ...,  2.6341, -0.5868, -0.0105]],         [[ 1.4296,  0.8156, -0.1442,  ..., -1.5969,  0.2655,  1.3892],          [ 0.0990, -0.1513, -0.2613,  ..., -0.5251, -0.1855, -0.1718],          [ 1.4328,  0.2132, -1.6794,  ...,  0.8488,  1.4868, -1.7160],          ...,          [-0.0693,  0.1337,  1.1090,  ..., -1.3724, -2.5672,  1.0906],          [ 0.2655,  0.3716, -0.1245,  ...,  0.7961, -0.3946,  1.0061],          [-0.8810,  0.1413, -0.6222,  ..., -0.4905, -0.3606, -1.0626]],         [[-0.0948, -0.0486,  0.0157,  ...,  2.1004, -1.5879, -0.2739],          [-0.2656,  1.1246,  1.0048,  ...,  0.4671, -0.1705, -0.7745],          [-0.3759,  0.2029, -1.7732,  ..., -0.2653, -2.3626, -1.0251],          ...,          [ 1.4900, -1.3544,  1.5717,  ..., -1.9406,  0.7142, -0.6601],          [ 0.0120,  0.9058,  0.0421,  ...,  1.5632,  1.1624,  0.1822],          [-0.9256,  0.8344, -0.9597,  ..., -0.4188,  0.2051,  0.6043]]],        [[[-0.6292,  1.5933,  1.1558,  ..., -1.0939,  0.3556, -1.9305],          [ 2.2168,  0.9184, -0.6098,  ...,  0.1250,  0.2496,  0.5268],          [ 0.6035, -0.7713,  0.4179,  ...,  0.1061,  0.2763, -1.1580],          ...,          [ 0.6361, -0.9818,  0.2838,  ..., -0.1032, -0.1063,  0.2971],          [-0.9087, -0.8842,  1.3305,  ...,  0.7932,  1.0652, -0.1426],          [-2.2427, -0.6605,  0.9667,  ..., -0.4021, -1.1495, -0.0572]],         [[-0.1344,  0.6562,  0.4687,  ...,  0.1312,  0.5327,  0.3450],          [ 0.4334,  1.3153,  1.9282,  ...,  0.5667,  1.4108,  0.4699],          [ 0.5254, -0.2920,  1.7819,  ..., -0.5157, -0.3931, -0.8093],          ...,          [-0.5848,  0.6157,  1.1588,  ...,  0.5449, -1.0721,  0.5217],          [ 0.3995,  0.2235,  0.2506,  ..., -0.3272,  0.8440,  0.4930],          [-0.8263, -0.0577, -0.9538,  ..., -1.2877,  1.6349,  1.3202]],         [[ 0.6381, -1.4398, -0.7744,  ...,  1.2140,  0.9096, -0.6753],          [ 0.4048, -2.5466,  1.1450,  ...,  0.5030,  0.4698,  0.5673],          [-0.0358,  0.2170, -0.6245,  ..., -0.4325,  0.5767, -0.2755],          ...,          [ 0.3158, -1.6521,  0.9919,  ...,  2.0221, -1.2303,  0.4039],          [ 0.2354, -0.9477, -0.6534,  ..., -0.5600, -1.3333,  0.5403],          [ 1.1120, -2.0893, -1.3755,  ...,  1.9954,  0.8662, -1.6815]]],        ...,        [[[ 1.2590,  0.1363, -0.6754,  ..., -0.8791,  1.2095, -0.1012],          [ 2.3050, -0.1425, -0.9242,  ..., -0.7649, -0.7488,  0.6949],          [ 0.4214,  0.3215, -2.3866,  ..., -0.5338,  0.4479, -0.8477],          ...,          [ 0.1499, -0.5690,  0.0180,  ...,  1.6823,  0.3056, -0.6216],          [-0.3886,  0.6260, -0.6109,  ...,  0.0346,  0.2253, -0.5103],          [-0.1228,  0.1755,  0.1834,  ..., -2.4334, -0.4735,  0.3909]],         [[-0.5463,  0.1758,  0.3594,  ..., -1.5349, -0.1570,  0.0686],          [-0.1374,  1.0209, -0.5383,  ..., -0.9182, -0.2435, -0.2757],          [ 0.6611, -0.2038, -1.1446,  ..., -1.4481,  0.6467, -0.6618],          ...,          [-0.2686,  0.0405, -0.1467,  ...,  1.0902,  0.5896, -0.7653],          [-1.9040,  0.0179,  1.1207,  ..., -0.2288, -1.6366,  1.1901],          [ 0.1832,  0.3417,  0.9626,  ...,  0.3803,  0.7350, -0.3099]],         [[-0.9969, -0.5508, -0.4998,  ...,  0.6936,  1.6136,  0.3220],          [-0.0770,  1.3169,  0.1651,  ...,  1.7485,  0.7226, -0.2574],          [ 0.0803, -0.9462,  1.2021,  ..., -0.0972,  0.0682,  0.1344],          ...,          [-1.7403,  1.7113,  3.0679,  ...,  1.0908,  1.0581, -0.5222],          [ 0.4028, -1.0059, -2.1630,  ..., -0.0682,  0.5164,  1.6635],          [ 2.7208, -0.5648, -0.1862,  ..., -1.5719, -0.3802,  0.2935]]],        [[[ 0.8409, -0.7438, -1.0032,  ...,  0.1318, -0.4320,  0.4415],          [ 1.5099, -1.1524,  1.1499,  ..., -1.6440, -0.0798,  0.6606],          [ 1.0045, -0.9537,  1.1316,  ..., -1.3674, -0.9758, -0.0078],          ...,          [ 0.3468,  0.5475, -0.7472,  ...,  1.5581,  0.2254,  0.8593],          [-0.0717,  0.4480,  1.3726,  ...,  0.6523, -1.1766, -0.3996],          [-1.6755, -0.8156,  0.5543,  ..., -1.4320,  0.4414, -0.1122]],         [[ 1.3380, -1.1875,  0.5178,  ...,  0.3197, -0.7422,  0.5158],          [-1.1908,  1.4007,  0.8123,  ..., -1.4919, -1.7273, -0.0800],          [-1.3901, -0.3755,  0.0897,  ...,  1.6764, -1.3049, -0.0079],          ...,          [-0.1568, -1.4188, -0.7429,  ..., -1.6218,  0.6604,  1.6529],          [ 0.6247,  0.6867, -1.0114,  ..., -0.0381,  0.1275, -0.8645],          [-0.0610,  0.5389,  0.3990,  ..., -1.0361, -2.4215, -0.6971]],         [[ 0.7516, -1.9676,  1.4015,  ...,  0.5336,  1.0704,  1.7422],          [-1.6988, -1.2900, -0.6327,  ..., -0.9592,  1.5238,  0.2264],          [ 1.0729,  0.8629, -0.5775,  ..., -0.7702, -0.0271,  0.7063],          ...,          [ 0.4322,  1.7422,  0.5302,  ...,  1.7000,  1.1956,  0.4742],          [ 0.4945,  0.2216, -1.3425,  ..., -0.9851,  0.1730,  1.0625],          [-0.6886, -0.1384, -0.4764,  ...,  0.3615,  0.5811,  0.4600]]],        [[[-0.8843,  0.8162, -0.5182,  ...,  0.3598, -0.5506, -0.5101],          [-0.4878, -1.6419, -0.5060,  ...,  1.8825, -0.1327,  0.3133],          [ 0.4729,  0.4339,  1.0820,  ..., -1.3299, -0.7871, -0.6630],          ...,          [-1.1407,  0.0937,  1.0086,  ...,  0.2854,  0.4308,  1.1841],          [ 0.3772, -0.8250,  1.1873,  ...,  0.1146, -0.7267,  0.4953],          [-0.3229, -1.0868, -0.0125,  ..., -0.6451,  1.2862, -1.9553]],         [[-0.4689, -0.3666, -0.3470,  ..., -0.0699, -1.9161, -0.4589],          [-0.4437,  0.9324, -2.2532,  ...,  0.1354,  1.1196, -0.0070],          [ 1.1838,  0.3169,  1.2460,  ..., -0.9694,  0.3669,  0.7385],          ...,          [-1.7229,  0.6705,  0.0683,  ...,  1.0143,  0.6204, -1.1060],          [ 0.2528, -2.3181, -0.0774,  ..., -0.3610,  0.4452, -0.3837],          [-1.2532, -0.3006,  0.6067,  ..., -0.8430, -0.5149,  0.8442]],         [[-1.8861, -0.4756,  0.9849,  ...,  0.7845, -0.8080, -0.6442],          [-0.7163,  0.8101, -0.1905,  ...,  0.3361,  0.6133, -0.1919],          [-0.7476, -0.5810, -0.1615,  ..., -0.5631,  0.0637, -0.1969],          ...,          [-0.9449, -0.9001,  1.0701,  ...,  0.4150,  0.1768, -0.4086],          [ 0.5126,  1.4135,  1.6389,  ..., -0.6361, -0.3524, -0.2547],          [ 0.0541, -1.5909, -1.5796,  ..., -0.1662, -0.7188, -0.6655]]]])

Input: tensor([[[[-1.8936,  0.4196,  1.2842,  ...,  1.2066,  0.7782,  1.3469],          [-0.8224,  0.4527, -0.0577,  ...,  1.4756,  1.1761, -0.7108],          [-1.6315,  0.8043,  2.6413,  ..., -1.3240,  0.9065, -0.8693],          ...,          [ 0.0383,  1.3328, -0.1353,  ..., -1.1770, -0.1116, -0.3206],          [-1.0151,  0.2528, -0.3343,  ..., -0.0416, -0.9868,  1.1128],          [-1.0028, -1.1892,  0.7485,  ...,  0.7481,  0.0498, -0.0744]],         [[-0.2884, -0.2759,  1.1363,  ...,  1.1605,  0.0775, -1.4702],          [-1.6069, -0.0638, -0.8533,  ...,  0.2473,  1.4863,  0.0158],          [ 2.5342,  0.6854,  1.1528,  ...,  0.6568, -0.5946,  0.1834],          ...,          [ 0.3353,  0.0865, -0.9538,  ..., -1.2018, -1.4665, -0.3575],          [-0.3430, -1.4583, -0.7826,  ...,  2.1256, -0.3949,  0.1570],          [ 0.9678, -1.7589,  0.9122,  ...,  0.4558,  1.4173,  1.6013]],         [[-0.7772,  0.4630,  0.6564,  ..., -1.8964, -2.1647, -0.5534],          [ 0.4105,  0.5011,  1.2573,  ...,  0.3236,  0.9842,  1.0977],          [-0.7429,  1.0571,  0.6543,  ...,  0.3400, -0.2293, -0.5091],          ...,          [ 0.1505, -0.3082,  0.3324,  ...,  0.6619, -0.0814,  0.6934],          [-1.7772, -1.9982,  0.5367,  ...,  0.1102, -0.7138,  0.8455],          [ 0.0332, -0.3734, -1.5362,  ..., -1.2318, -0.4791, -1.6185]]],        [[[ 0.0160,  0.7455,  0.3158,  ..., -0.0860,  0.2626,  1.1479],          [-0.4146,  1.8953,  0.0897,  ..., -0.3885,  1.2116, -1.0973],          [-0.6872, -1.8162,  0.1554,  ..., -1.7179,  1.0908,  0.8081],          ...,          [ 0.1696, -1.8558,  0.1469,  ...,  0.3142,  2.3475,  0.4731],          [ 0.1529, -1.0062,  0.7995,  ...,  0.2377,  0.8177,  0.9386],          [ 0.0217, -0.4921, -0.8103,  ...,  2.6341, -0.5868, -0.0105]],         [[ 1.4296,  0.8156, -0.1442,  ..., -1.5969,  0.2655,  1.3892],          [ 0.0990, -0.1513, -0.2613,  ..., -0.5251, -0.1855, -0.1718],          [ 1.4328,  0.2132, -1.6794,  ...,  0.8488,  1.4868, -1.7160],          ...,          [-0.0693,  0.1337,  1.1090,  ..., -1.3724, -2.5672,  1.0906],          [ 0.2655,  0.3716, -0.1245,  ...,  0.7961, -0.3946,  1.0061],          [-0.8810,  0.1413, -0.6222,  ..., -0.4905, -0.3606, -1.0626]],         [[-0.0948, -0.0486,  0.0157,  ...,  2.1004, -1.5879, -0.2739],          [-0.2656,  1.1246,  1.0048,  ...,  0.4671, -0.1705, -0.7745],          [-0.3759,  0.2029, -1.7732,  ..., -0.2653, -2.3626, -1.0251],          ...,          [ 1.4900, -1.3544,  1.5717,  ..., -1.9406,  0.7142, -0.6601],          [ 0.0120,  0.9058,  0.0421,  ...,  1.5632,  1.1624,  0.1822],          [-0.9256,  0.8344, -0.9597,  ..., -0.4188,  0.2051,  0.6043]]],        [[[-0.6292,  1.5933,  1.1558,  ..., -1.0939,  0.3556, -1.9305],          [ 2.2168,  0.9184, -0.6098,  ...,  0.1250,  0.2496,  0.5268],          [ 0.6035, -0.7713,  0.4179,  ...,  0.1061,  0.2763, -1.1580],          ...,          [ 0.6361, -0.9818,  0.2838,  ..., -0.1032, -0.1063,  0.2971],          [-0.9087, -0.8842,  1.3305,  ...,  0.7932,  1.0652, -0.1426],          [-2.2427, -0.6605,  0.9667,  ..., -0.4021, -1.1495, -0.0572]],         [[-0.1344,  0.6562,  0.4687,  ...,  0.1312,  0.5327,  0.3450],          [ 0.4334,  1.3153,  1.9282,  ...,  0.5667,  1.4108,  0.4699],          [ 0.5254, -0.2920,  1.7819,  ..., -0.5157, -0.3931, -0.8093],          ...,          [-0.5848,  0.6157,  1.1588,  ...,  0.5449, -1.0721,  0.5217],          [ 0.3995,  0.2235,  0.2506,  ..., -0.3272,  0.8440,  0.4930],          [-0.8263, -0.0577, -0.9538,  ..., -1.2877,  1.6349,  1.3202]],         [[ 0.6381, -1.4398, -0.7744,  ...,  1.2140,  0.9096, -0.6753],          [ 0.4048, -2.5466,  1.1450,  ...,  0.5030,  0.4698,  0.5673],          [-0.0358,  0.2170, -0.6245,  ..., -0.4325,  0.5767, -0.2755],          ...,          [ 0.3158, -1.6521,  0.9919,  ...,  2.0221, -1.2303,  0.4039],          [ 0.2354, -0.9477, -0.6534,  ..., -0.5600, -1.3333,  0.5403],          [ 1.1120, -2.0893, -1.3755,  ...,  1.9954,  0.8662, -1.6815]]],        ...,        [[[ 1.2590,  0.1363, -0.6754,  ..., -0.8791,  1.2095, -0.1012],          [ 2.3050, -0.1425, -0.9242,  ..., -0.7649, -0.7488,  0.6949],          [ 0.4214,  0.3215, -2.3866,  ..., -0.5338,  0.4479, -0.8477],          ...,          [ 0.1499, -0.5690,  0.0180,  ...,  1.6823,  0.3056, -0.6216],          [-0.3886,  0.6260, -0.6109,  ...,  0.0346,  0.2253, -0.5103],          [-0.1228,  0.1755,  0.1834,  ..., -2.4334, -0.4735,  0.3909]],         [[-0.5463,  0.1758,  0.3594,  ..., -1.5349, -0.1570,  0.0686],          [-0.1374,  1.0209, -0.5383,  ..., -0.9182, -0.2435, -0.2757],          [ 0.6611, -0.2038, -1.1446,  ..., -1.4481,  0.6467, -0.6618],          ...,          [-0.2686,  0.0405, -0.1467,  ...,  1.0902,  0.5896, -0.7653],          [-1.9040,  0.0179,  1.1207,  ..., -0.2288, -1.6366,  1.1901],          [ 0.1832,  0.3417,  0.9626,  ...,  0.3803,  0.7350, -0.3099]],         [[-0.9969, -0.5508, -0.4998,  ...,  0.6936,  1.6136,  0.3220],          [-0.0770,  1.3169,  0.1651,  ...,  1.7485,  0.7226, -0.2574],          [ 0.0803, -0.9462,  1.2021,  ..., -0.0972,  0.0682,  0.1344],          ...,          [-1.7403,  1.7113,  3.0679,  ...,  1.0908,  1.0581, -0.5222],          [ 0.4028, -1.0059, -2.1630,  ..., -0.0682,  0.5164,  1.6635],          [ 2.7208, -0.5648, -0.1862,  ..., -1.5719, -0.3802,  0.2935]]],        [[[ 0.8409, -0.7438, -1.0032,  ...,  0.1318, -0.4320,  0.4415],          [ 1.5099, -1.1524,  1.1499,  ..., -1.6440, -0.0798,  0.6606],          [ 1.0045, -0.9537,  1.1316,  ..., -1.3674, -0.9758, -0.0078],          ...,          [ 0.3468,  0.5475, -0.7472,  ...,  1.5581,  0.2254,  0.8593],          [-0.0717,  0.4480,  1.3726,  ...,  0.6523, -1.1766, -0.3996],          [-1.6755, -0.8156,  0.5543,  ..., -1.4320,  0.4414, -0.1122]],         [[ 1.3380, -1.1875,  0.5178,  ...,  0.3197, -0.7422,  0.5158],          [-1.1908,  1.4007,  0.8123,  ..., -1.4919, -1.7273, -0.0800],          [-1.3901, -0.3755,  0.0897,  ...,  1.6764, -1.3049, -0.0079],          ...,          [-0.1568, -1.4188, -0.7429,  ..., -1.6218,  0.6604,  1.6529],          [ 0.6247,  0.6867, -1.0114,  ..., -0.0381,  0.1275, -0.8645],          [-0.0610,  0.5389,  0.3990,  ..., -1.0361, -2.4215, -0.6971]],         [[ 0.7516, -1.9676,  1.4015,  ...,  0.5336,  1.0704,  1.7422],          [-1.6988, -1.2900, -0.6327,  ..., -0.9592,  1.5238,  0.2264],          [ 1.0729,  0.8629, -0.5775,  ..., -0.7702, -0.0271,  0.7063],          ...,          [ 0.4322,  1.7422,  0.5302,  ...,  1.7000,  1.1956,  0.4742],          [ 0.4945,  0.2216, -1.3425,  ..., -0.9851,  0.1730,  1.0625],          [-0.6886, -0.1384, -0.4764,  ...,  0.3615,  0.5811,  0.4600]]],        [[[-0.8843,  0.8162, -0.5182,  ...,  0.3598, -0.5506, -0.5101],          [-0.4878, -1.6419, -0.5060,  ...,  1.8825, -0.1327,  0.3133],          [ 0.4729,  0.4339,  1.0820,  ..., -1.3299, -0.7871, -0.6630],          ...,          [-1.1407,  0.0937,  1.0086,  ...,  0.2854,  0.4308,  1.1841],          [ 0.3772, -0.8250,  1.1873,  ...,  0.1146, -0.7267,  0.4953],          [-0.3229, -1.0868, -0.0125,  ..., -0.6451,  1.2862, -1.9553]],         [[-0.4689, -0.3666, -0.3470,  ..., -0.0699, -1.9161, -0.4589],          [-0.4437,  0.9324, -2.2532,  ...,  0.1354,  1.1196, -0.0070],          [ 1.1838,  0.3169,  1.2460,  ..., -0.9694,  0.3669,  0.7385],          ...,          [-1.7229,  0.6705,  0.0683,  ...,  1.0143,  0.6204, -1.1060],          [ 0.2528, -2.3181, -0.0774,  ..., -0.3610,  0.4452, -0.3837],          [-1.2532, -0.3006,  0.6067,  ..., -0.8430, -0.5149,  0.8442]],         [[-1.8861, -0.4756,  0.9849,  ...,  0.7845, -0.8080, -0.6442],          [-0.7163,  0.8101, -0.1905,  ...,  0.3361,  0.6133, -0.1919],          [-0.7476, -0.5810, -0.1615,  ..., -0.5631,  0.0637, -0.1969],          ...,          [-0.9449, -0.9001,  1.0701,  ...,  0.4150,  0.1768, -0.4086],          [ 0.5126,  1.4135,  1.6389,  ..., -0.6361, -0.3524, -0.2547],          [ 0.0541, -1.5909, -1.5796,  ..., -0.1662, -0.7188, -0.6655]]]])

Input: tensor([[[[-1.8936,  0.4196,  1.2842,  ...,  1.2066,  0.7782,  1.3469],          [-0.8224,  0.4527, -0.0577,  ...,  1.4756,  1.1761, -0.7108],          [-1.6315,  0.8043,  2.6413,  ..., -1.3240,  0.9065, -0.8693],          ...,          [ 0.0383,  1.3328, -0.1353,  ..., -1.1770, -0.1116, -0.3206],          [-1.0151,  0.2528, -0.3343,  ..., -0.0416, -0.9868,  1.1128],          [-1.0028, -1.1892,  0.7485,  ...,  0.7481,  0.0498, -0.0744]],         [[-0.2884, -0.2759,  1.1363,  ...,  1.1605,  0.0775, -1.4702],          [-1.6069, -0.0638, -0.8533,  ...,  0.2473,  1.4863,  0.0158],          [ 2.5342,  0.6854,  1.1528,  ...,  0.6568, -0.5946,  0.1834],          ...,          [ 0.3353,  0.0865, -0.9538,  ..., -1.2018, -1.4665, -0.3575],          [-0.3430, -1.4583, -0.7826,  ...,  2.1256, -0.3949,  0.1570],          [ 0.9678, -1.7589,  0.9122,  ...,  0.4558,  1.4173,  1.6013]],         [[-0.7772,  0.4630,  0.6564,  ..., -1.8964, -2.1647, -0.5534],          [ 0.4105,  0.5011,  1.2573,  ...,  0.3236,  0.9842,  1.0977],          [-0.7429,  1.0571,  0.6543,  ...,  0.3400, -0.2293, -0.5091],          ...,          [ 0.1505, -0.3082,  0.3324,  ...,  0.6619, -0.0814,  0.6934],          [-1.7772, -1.9982,  0.5367,  ...,  0.1102, -0.7138,  0.8455],          [ 0.0332, -0.3734, -1.5362,  ..., -1.2318, -0.4791, -1.6185]]],        [[[ 0.0160,  0.7455,  0.3158,  ..., -0.0860,  0.2626,  1.1479],          [-0.4146,  1.8953,  0.0897,  ..., -0.3885,  1.2116, -1.0973],          [-0.6872, -1.8162,  0.1554,  ..., -1.7179,  1.0908,  0.8081],          ...,          [ 0.1696, -1.8558,  0.1469,  ...,  0.3142,  2.3475,  0.4731],          [ 0.1529, -1.0062,  0.7995,  ...,  0.2377,  0.8177,  0.9386],          [ 0.0217, -0.4921, -0.8103,  ...,  2.6341, -0.5868, -0.0105]],         [[ 1.4296,  0.8156, -0.1442,  ..., -1.5969,  0.2655,  1.3892],          [ 0.0990, -0.1513, -0.2613,  ..., -0.5251, -0.1855, -0.1718],          [ 1.4328,  0.2132, -1.6794,  ...,  0.8488,  1.4868, -1.7160],          ...,          [-0.0693,  0.1337,  1.1090,  ..., -1.3724, -2.5672,  1.0906],          [ 0.2655,  0.3716, -0.1245,  ...,  0.7961, -0.3946,  1.0061],          [-0.8810,  0.1413, -0.6222,  ..., -0.4905, -0.3606, -1.0626]],         [[-0.0948, -0.0486,  0.0157,  ...,  2.1004, -1.5879, -0.2739],          [-0.2656,  1.1246,  1.0048,  ...,  0.4671, -0.1705, -0.7745],          [-0.3759,  0.2029, -1.7732,  ..., -0.2653, -2.3626, -1.0251],          ...,          [ 1.4900, -1.3544,  1.5717,  ..., -1.9406,  0.7142, -0.6601],          [ 0.0120,  0.9058,  0.0421,  ...,  1.5632,  1.1624,  0.1822],          [-0.9256,  0.8344, -0.9597,  ..., -0.4188,  0.2051,  0.6043]]],        [[[-0.6292,  1.5933,  1.1558,  ..., -1.0939,  0.3556, -1.9305],          [ 2.2168,  0.9184, -0.6098,  ...,  0.1250,  0.2496,  0.5268],          [ 0.6035, -0.7713,  0.4179,  ...,  0.1061,  0.2763, -1.1580],          ...,          [ 0.6361, -0.9818,  0.2838,  ..., -0.1032, -0.1063,  0.2971],          [-0.9087, -0.8842,  1.3305,  ...,  0.7932,  1.0652, -0.1426],          [-2.2427, -0.6605,  0.9667,  ..., -0.4021, -1.1495, -0.0572]],         [[-0.1344,  0.6562,  0.4687,  ...,  0.1312,  0.5327,  0.3450],          [ 0.4334,  1.3153,  1.9282,  ...,  0.5667,  1.4108,  0.4699],          [ 0.5254, -0.2920,  1.7819,  ..., -0.5157, -0.3931, -0.8093],          ...,          [-0.5848,  0.6157,  1.1588,  ...,  0.5449, -1.0721,  0.5217],          [ 0.3995,  0.2235,  0.2506,  ..., -0.3272,  0.8440,  0.4930],          [-0.8263, -0.0577, -0.9538,  ..., -1.2877,  1.6349,  1.3202]],         [[ 0.6381, -1.4398, -0.7744,  ...,  1.2140,  0.9096, -0.6753],          [ 0.4048, -2.5466,  1.1450,  ...,  0.5030,  0.4698,  0.5673],          [-0.0358,  0.2170, -0.6245,  ..., -0.4325,  0.5767, -0.2755],          ...,          [ 0.3158, -1.6521,  0.9919,  ...,  2.0221, -1.2303,  0.4039],          [ 0.2354, -0.9477, -0.6534,  ..., -0.5600, -1.3333,  0.5403],          [ 1.1120, -2.0893, -1.3755,  ...,  1.9954,  0.8662, -1.6815]]],        ...,        [[[ 1.2590,  0.1363, -0.6754,  ..., -0.8791,  1.2095, -0.1012],          [ 2.3050, -0.1425, -0.9242,  ..., -0.7649, -0.7488,  0.6949],          [ 0.4214,  0.3215, -2.3866,  ..., -0.5338,  0.4479, -0.8477],          ...,          [ 0.1499, -0.5690,  0.0180,  ...,  1.6823,  0.3056, -0.6216],          [-0.3886,  0.6260, -0.6109,  ...,  0.0346,  0.2253, -0.5103],          [-0.1228,  0.1755,  0.1834,  ..., -2.4334, -0.4735,  0.3909]],         [[-0.5463,  0.1758,  0.3594,  ..., -1.5349, -0.1570,  0.0686],          [-0.1374,  1.0209, -0.5383,  ..., -0.9182, -0.2435, -0.2757],          [ 0.6611, -0.2038, -1.1446,  ..., -1.4481,  0.6467, -0.6618],          ...,          [-0.2686,  0.0405, -0.1467,  ...,  1.0902,  0.5896, -0.7653],          [-1.9040,  0.0179,  1.1207,  ..., -0.2288, -1.6366,  1.1901],          [ 0.1832,  0.3417,  0.9626,  ...,  0.3803,  0.7350, -0.3099]],         [[-0.9969, -0.5508, -0.4998,  ...,  0.6936,  1.6136,  0.3220],          [-0.0770,  1.3169,  0.1651,  ...,  1.7485,  0.7226, -0.2574],          [ 0.0803, -0.9462,  1.2021,  ..., -0.0972,  0.0682,  0.1344],          ...,          [-1.7403,  1.7113,  3.0679,  ...,  1.0908,  1.0581, -0.5222],          [ 0.4028, -1.0059, -2.1630,  ..., -0.0682,  0.5164,  1.6635],          [ 2.7208, -0.5648, -0.1862,  ..., -1.5719, -0.3802,  0.2935]]],        [[[ 0.8409, -0.7438, -1.0032,  ...,  0.1318, -0.4320,  0.4415],          [ 1.5099, -1.1524,  1.1499,  ..., -1.6440, -0.0798,  0.6606],          [ 1.0045, -0.9537,  1.1316,  ..., -1.3674, -0.9758, -0.0078],          ...,          [ 0.3468,  0.5475, -0.7472,  ...,  1.5581,  0.2254,  0.8593],          [-0.0717,  0.4480,  1.3726,  ...,  0.6523, -1.1766, -0.3996],          [-1.6755, -0.8156,  0.5543,  ..., -1.4320,  0.4414, -0.1122]],         [[ 1.3380, -1.1875,  0.5178,  ...,  0.3197, -0.7422,  0.5158],          [-1.1908,  1.4007,  0.8123,  ..., -1.4919, -1.7273, -0.0800],          [-1.3901, -0.3755,  0.0897,  ...,  1.6764, -1.3049, -0.0079],          ...,          [-0.1568, -1.4188, -0.7429,  ..., -1.6218,  0.6604,  1.6529],          [ 0.6247,  0.6867, -1.0114,  ..., -0.0381,  0.1275, -0.8645],          [-0.0610,  0.5389,  0.3990,  ..., -1.0361, -2.4215, -0.6971]],         [[ 0.7516, -1.9676,  1.4015,  ...,  0.5336,  1.0704,  1.7422],          [-1.6988, -1.2900, -0.6327,  ..., -0.9592,  1.5238,  0.2264],          [ 1.0729,  0.8629, -0.5775,  ..., -0.7702, -0.0271,  0.7063],          ...,          [ 0.4322,  1.7422,  0.5302,  ...,  1.7000,  1.1956,  0.4742],          [ 0.4945,  0.2216, -1.3425,  ..., -0.9851,  0.1730,  1.0625],          [-0.6886, -0.1384, -0.4764,  ...,  0.3615,  0.5811,  0.4600]]],        [[[-0.8843,  0.8162, -0.5182,  ...,  0.3598, -0.5506, -0.5101],          [-0.4878, -1.6419, -0.5060,  ...,  1.8825, -0.1327,  0.3133],          [ 0.4729,  0.4339,  1.0820,  ..., -1.3299, -0.7871, -0.6630],          ...,          [-1.1407,  0.0937,  1.0086,  ...,  0.2854,  0.4308,  1.1841],          [ 0.3772, -0.8250,  1.1873,  ...,  0.1146, -0.7267,  0.4953],          [-0.3229, -1.0868, -0.0125,  ..., -0.6451,  1.2862, -1.9553]],         [[-0.4689, -0.3666, -0.3470,  ..., -0.0699, -1.9161, -0.4589],          [-0.4437,  0.9324, -2.2532,  ...,  0.1354,  1.1196, -0.0070],          [ 1.1838,  0.3169,  1.2460,  ..., -0.9694,  0.3669,  0.7385],          ...,          [-1.7229,  0.6705,  0.0683,  ...,  1.0143,  0.6204, -1.1060],          [ 0.2528, -2.3181, -0.0774,  ..., -0.3610,  0.4452, -0.3837],          [-1.2532, -0.3006,  0.6067,  ..., -0.8430, -0.5149,  0.8442]],         [[-1.8861, -0.4756,  0.9849,  ...,  0.7845, -0.8080, -0.6442],          [-0.7163,  0.8101, -0.1905,  ...,  0.3361,  0.6133, -0.1919],          [-0.7476, -0.5810, -0.1615,  ..., -0.5631,  0.0637, -0.1969],          ...,          [-0.9449, -0.9001,  1.0701,  ...,  0.4150,  0.1768, -0.4086],          [ 0.5126,  1.4135,  1.6389,  ..., -0.6361, -0.3524, -0.2547],          [ 0.0541, -1.5909, -1.5796,  ..., -0.1662, -0.7188, -0.6655]]]])


def from_isi_citation(cls, reference: str) -> "Article":
        match = ISI_CITATION_PATTERN.match(reference)
        if not match:
            raise InvalidReference(reference)
        data = {key: [value] for key, value in match.groupdict().items() if value}
        processed = parse_all(data)
        return cls(
            title=processed.get("title"),
            authors=processed.get("authors", []),
            year=processed.get("year"),
            journal=processed.get("source_abbreviation"),
            volume=processed.get("volume"),
            page=processed.get("beginning_page"),
            doi=processed.get("DOI"),
            extra=processed,
            sources={reference},
        )

from_isi_citation(cls=<class 'wostools.article.Article'>, reference='L Antuan, 2008, P IEEE, V69, P1810, DOI DOI 10.1109/JPROC.2008.2004315')

<re.Match object; span=(0, 70), match='L Antuan, 2008, P IEEE, V69, P1810, DOI DOI 10.11>


def next_player_move(self, letter_location_set):
        player_to_move_id, player_rack = get_current_player_data(
            self.move_number,
            self.player_rack_list
        )

        is_legal_move = move_is_legal(self.board,
                                      self.move_number,
                                      letter_location_set,
                                      player_rack)

        if is_legal_move:
            if move_successfully_challenged():
                letter_location_set = set()

            for move_letter, board_location in letter_location_set:
                tile_index = get_rack_tile_index(player_rack, move_letter)
                tile_obj = player_rack.pop(tile_index)
                self.board[board_location] = tile_obj

            move_score = score_move(letter_location_set, self.board)
            self.player_score_list_list[player_to_move_id].append(move_score)
            self._refill_player_rack(player_rack)
            self._cancel_bonus_squares(letter_location_set)

            if len(player_rack) == 0 and len(self.tile_bag) == 0:  # Final move
                last_move_score_list = score_end_of_game(self.player_rack_list,
                                                         player_to_move_id)

                for i, last_move_score in enumerate(last_move_score_list):
                    self.player_score_list_list[i].append(last_move_score)

                conclude_game(self.player_score_list_list)

            self.move_number += 1
            return True
        else:
            return False

next_player_move(self=  abcdefghijklmno1 _______________2 _______________3 _______________4 _______________5 _______________6 _______________7 _______________8 _______★_______9 _______________10_______________11_______________12_______________13_______________14_______________15_______________[[Q, E, O, S, G, H, E, B, A, K, E, R], [R, Z, L, A, U, L, A], [W, C, E, T, N, E, E], [T, R, O, B, T, N, N]]Moves played: 0Player 1's move72 tiles remain in bagPlayer 1: 0Player 2: 0Player 3: 0Player 4: 0, letter_location_set={('K', ('j', 8)), ('B', ('h', 8)), ('A', ('i', 8)), ('E', ('k', 8)), ('R', ('l', 8))}, self.board=  abcdefghijklmno1 _______________2 _______________3 _______________4 _______________5 _______________6 _______________7 _______________8 _______★_______9 _______________10_______________11_______________12_______________13_______________14_______________15_______________, self.move_number=0, self.player_rack_list=[[Q, E, O, S, G, H, E, B, A, K, E, R], [R, Z, L, A, U, L, A], [W, C, E, T, N, E, E], [T, R, O, B, T, N, N]], self.player_score_list_list=[[], [], [], []], self.tile_bag=[*, *, A, A, A, A, A, A, A, B, C, D, D, D, D, E, E, E, E, E, E, E, F, F, G, G, H, I, I, I, I, I, I, I, I, I, J, K, L, L, M, M, N, N, N, O, O, O, O, O, O, P, P, R, R, R, R, S, S, S, T, T, T, U, U, U, V, V, W, X, Y, Y])


def format_pair(prefix, arg, value):
    if arg is _arg_source_missing:
        arg_lines = []
        value_prefix = prefix
    else:
        arg_lines = indented_lines(prefix, arg)
        value_prefix = arg_lines[-1] + ': '

    looksLikeAString = value[0] + value[-1] in ["''", '""']
    if looksLikeAString:  # Align the start of multiline strings.
        value = prefixLinesAfterFirst(' ', value)

    value_lines = indented_lines(value_prefix, value)
    lines = arg_lines[:-1] + value_lines
    return '\n'.join(lines)

format_pair(prefix='    ', arg='multilineStr', value="'line1\nline2'")


def run_validator_for_test_file(filename: str) -> List:
    test_file_path = os.path.join(
        os.path.dirname(os.path.abspath(__file__)),
        'test_files',
        filename,
    )
    with open(test_file_path, 'r') as file_handler:
        raw_content = file_handler.read()
    tree = ast.parse(raw_content)
    checker = SuperMarionChecker(tree=tree, filename=test_file_path)

    return list(checker.run())

run_validator_for_test_file(filename='ok_pipe.py')

"from super_mario import BasePipeline, process_pipe\n\n\nclass SimplePipeline(BasePipeline):\n    pipeline = [\n        'sum_numbers',\n        'multiply_numbers',\n    ]\n\n    @process_pipe\n    @staticmethod\n    def sum_numbers(a, b):\n        return {'d': a + b}\n\n    @process_pipe\n    def multiply_numbers(c, d):\n        return {'e': c * d}\n"

{body=[<ast.ImportFrom object at 0x7feb90bccfa0>, <ast.ClassDef object at 0x7feb90bcceb0>], type_ignores=[]}

{body=[<ast.ImportFrom object at 0x7feb90bccfa0>, <ast.ClassDef object at 0x7feb90bcceb0>], type_ignores=[], parent=None}


def __new__(mcs, name, bases, dct):
        for verb in ['get', 'delete', 'update']:
            if '__%s__' % verb in dct:
                info = dct['__%s__' % verb]
                args = info[1] if len(info) >= 2 else []
                kwargs = info[2] if len(info) == 3 else {}
                dct[verb] = Type.__build_func(
                    verb,
                    args,
                    kwargs
                )
        for verb in ['create', 'list']:
            if '__%s__' % verb in dct:
                info = dct['__%s__' % verb]
                args = info[1] if len(info) >= 2 else ()
                args = ('connection',) + args
                kwargs = info[2] if len(info) == 3 else {}
                dct[verb] = classmethod(Type.__build_func(
                    verb,
                    args,
                    kwargs
                ))
        return super(Type, mcs).__new__(mcs, name, (mcs.Base,) + bases, dct)

__new__(mcs=<class 'pyutrack.util.Type'>, name='Issue', bases=(<class 'object'>,), dct={'__module__': 'pyutrack.resources', '__get__': ('issue/%(id)s',), '__create__': ('issue/', ('project',), {'summary': None, 'description': None}), '__delete__': ('issue/%(id)s',), '__update__': ('issue/%(id)s/', (), {'summary': None, 'description': None}), '__aliases__': {'project': 'projectShortName'}, '__doc__': None, '__qualname__': 'Issue'}, __class__=<class 'pyutrack.util.Type'>)

'Issue'

{'__module__': 'pyutrack.resources', '__get__': ('issue/%(id)s',), '__create__': ('issue/', ('project',), {'summary': None, 'description': None}), '__delete__': ('issue/%(id)s',), '__update__': ('issue/%(id)s/', (), {'summary': None, 'description': None}), '__aliases__': {'project': 'projectShortName'}, '__doc__': None, '__qualname__': 'Issue', 'get': <function <lambda> at 0x7f681a929b80>}

{'__module__': 'pyutrack.resources', '__get__': ('issue/%(id)s',), '__create__': ('issue/', ('project',), {'summary': None, 'description': None}), '__delete__': ('issue/%(id)s',), '__update__': ('issue/%(id)s/', (), {'summary': None, 'description': None}), '__aliases__': {'project': 'projectShortName'}, '__doc__': None, '__qualname__': 'Issue', 'get': <function <lambda> at 0x7f681a929b80>, 'delete': <function <lambda> at 0x7f681a93e310>}

{'__module__': 'pyutrack.resources', '__get__': ('issue/%(id)s',), '__create__': ('issue/', ('project',), {'summary': None, 'description': None}), '__delete__': ('issue/%(id)s',), '__update__': ('issue/%(id)s/', (), {'summary': None, 'description': None}), '__aliases__': {'project': 'projectShortName'}, '__doc__': None, '__qualname__': 'Issue', 'get': <function <lambda> at 0x7f681a929b80>, 'delete': <function <lambda> at 0x7f681a93e310>, 'update': <function <lambda> at 0x7f681a93e3a0>}

{'__module__': 'pyutrack.resources', '__get__': ('issue/%(id)s',), '__create__': ('issue/', ('project',), {'summary': None, 'description': None}), '__delete__': ('issue/%(id)s',), '__update__': ('issue/%(id)s/', (), {'summary': None, 'description': None}), '__aliases__': {'project': 'projectShortName'}, '__doc__': None, '__qualname__': 'Issue', 'get': <function <lambda> at 0x7f681a929b80>, 'delete': <function <lambda> at 0x7f681a93e310>, 'update': <function <lambda> at 0x7f681a93e3a0>, 'create': <classmethod object at 0x7f681a937eb0>}


def _readREFullObj(fp, array, dtype):

        nbyte = HarFileIO._getEntrySize(fp)
        dataForm = '=4sii'

        V = HarFileIO._unpack_data(fp, dataForm)

        if fb(V[0]) != '    ':
            raise Exception("Encountered characters at read7D[1]")

        nrec = V[1]
        NDim = V[2]
        dataForm = "=" + ('i' * NDim)

        V = HarFileIO._unpack_data(fp, dataForm)

        if nbyte != HarFileIO._getEntrySize(fp):
            raise RuntimeError("Header corrupted read7D[0] @ %d" % fp.tell())

        oldshape = array.shape
        array = array.flatten('F')
        idata = 0
        while nrec > 1:
            nbyte = HarFileIO._getEntrySize(fp)
            dataForm = '4s15i'
            V = HarFileIO._unpack_data(fp, dataForm)

            if fb(V[0]) != '    ':
                raise RuntimeError("Encountered characters at first four positions at)SetEl")

            if nbyte != HarFileIO._getEntrySize(fp):
                raise RuntimeError('read7D data[2] corrupted')

            nbyte = HarFileIO._getEntrySize(fp)
            ndata = (nbyte - 8) // struct.calcsize(dtype)
            dataForm = '4si' + str(ndata) + dtype
            V = HarFileIO._unpack_data(fp, dataForm)

            if nbyte != HarFileIO._getEntrySize(fp):
                raise RuntimeError('read7D data[2])corrupted')

            if fb(V[0]) != '    ':
                raise RuntimeError("Encountered characters at read7D[2]")

            nrec = V[1]
            array[idata:idata + ndata] = V[2:]
            idata += ndata
        array = array.reshape(oldshape, order='F')
        return array

_readREFullObj(fp=<_io.BufferedReader name='/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/GEMPACKsoftware+HARPY/GEMPACKsoftware+HARPY/test_remove_header_array.har'>, array=array([[0., 0.],       [0., 0.]], dtype=float32), dtype='f')


def contains_sublist(list_: List[Any], sublist: List[Any]) -> bool:
    """Determine if a `list` contains a `sublist`.

    :param list_:
        list to search for the `sublist` in.
    :param sublist:
        Sub list to search for.

    :return:
        True if `list` contains `sublist`.

    """
    # Adapted from: https://stackoverflow.com/a/12576755
    if not sublist:
        return False
    for i in range(len(list_)):
        if list_[i] == sublist[0] and list_[i : i + len(sublist)] == sublist:
            return True
    return False

contains_sublist(list_=[1, 2, 3, 4], sublist=[1, 2])


def to_css_class(s):
    """
    Given a string (e.g. a table name) returns a valid unique CSS class.
    For simple cases, just returns the string again. If the string is not a
    valid CSS class (we disallow - and _ prefixes even though they are valid
    as they may be confused with browser prefixes) we strip invalid characters
    and add a 6 char md5 sum suffix, to make sure two tables with identical
    names after stripping characters don't end up with the same CSS class.
    """
    if css_class_re.match(s):
        return s
    md5_suffix = hashlib.md5(s.encode("utf8")).hexdigest()[:6]
    # Strip leading _, -
    s = s.lstrip("_").lstrip("-")
    # Replace any whitespace with hyphens
    s = "-".join(s.split())
    # Remove any remaining invalid characters
    s = css_invalid_chars_re.sub("", s)
    # Attach the md5 suffix
    bits = [b for b in (s, md5_suffix) if b]
    return "-".join(bits)

to_css_class(s='table/with/slashes.csv')


def clasifier(optimizer):
    X, y = make_classification(
        n_samples=1000, n_features=100, n_informative=75, random_state=1111, n_classes=2, class_sep=2.5
    )
    y = one_hot(y)

    X -= np.mean(X, axis=0)
    X /= np.std(X, axis=0)
    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.15, random_state=1111)

    model = NeuralNet(
        layers=[
            Dense(128, Parameters(init="uniform")),
            Activation("relu"),
            Dropout(0.5),
            Dense(64, Parameters(init="normal")),
            Activation("relu"),
            Dense(2),
            Activation("softmax"),
        ],
        loss="categorical_crossentropy",
        optimizer=optimizer,
        metric="accuracy",
        batch_size=64,
        max_epochs=10,
    )
    model.fit(X_train, y_train)
    predictions = model.predict(X_test)
    return roc_auc_score(y_test[:, 0], predictions[:, 0])

clasifier(optimizer={rho=0.95, eps=1e-08, lr=1.0})

{verbose=True, shuffle=False, optimizer=<mla.neuralnet.optimizers.Adadelta object at 0x7f43904a38e0>, layers=[<mla.neuralnet.layers.basic.Dense object at 0x7f43904a3610>, <mla.neuralnet.layers.basic.Activation object at 0x7f43904a33d0>, <mla.neuralnet.layers.basic.Dropout object at 0x7f43904a32b0>, <mla.neuralnet.layers.basic.Dense object at 0x7f43904a3c70>, <mla.neuralnet.layers.basic.Activation object at 0x7f43904a3550>, <mla.neuralnet.layers.basic.Dense object at 0x7f43904a3820>, <mla.neuralnet.layers.basic.Activation object at 0x7f43904a3730>], batch_size=64, max_epochs=10, _n_layers=0, log_metric=True, metric_name='accuracy', bprop_entry=-1, training=False, _initialized=False}


def type_correct_with(cdict, cfg_tuple):
    """Use type hints of the cfg tuple to cast parameters i.e. attributes into their intended types"""
    # TODO: This would be cleaner, if the config would use Schema or derivative in the
    # first place and use its validation process
    res = {}
    for k, v in cdict.items():
        typename = getattr(cfg_tuple, k)
        res.update({k: type(typename)(v)})
    return res

type_correct_with(cdict={'bar': '42'}, cfg_tuple={})


def __handle_content_url(content_url):
        content_url = replace_html(content_url)
        return ('http://mp.weixin.qq.com{}'.format(
            content_url) if 'http://mp.weixin.qq.com' not in content_url else content_url) if content_url else ''

__handle_content_url(content_url='/s?timestamp=1500903767&src=3&ver=1&signature=X4l0IQ091w0DY2ERU7fD*h0VUwBxeHPOJH-Uk-vAfaPamMl6ij7fqAIHomnXQ2X2*2J94H0pixVjsjEkL0TbILtKInZ4hqPp3-lC1nQZcN9Fd*BGbTQp7WlZyzLvCXy0Z8yFVF*lIDlo75pemv7kW8wov4Hz5-uiVzBT5q*Nwaw=')


idx_pad0 = _get_idx(ndim, dim, slice(pw[0], pw[0]+1, None))


def argumentToString(obj):
    s = DEFAULT_ARG_TO_STRING_FUNCTION(obj)
    s = s.replace('\\n', '\n')  # Preserve string newlines in output.
    return s

argumentToString(obj=1)


def _unpack_args(args, nargs_spec):
    """Given an iterable of arguments and an iterable of nargs specifications,
    it returns a tuple with all the unpacked arguments at the first index
    and all remaining arguments as the second.

    The nargs specification is the number of arguments that should be consumed
    or `-1` to indicate that this position should eat up all the remainders.

    Missing items are filled with `None`.
    """
    args = deque(args)
    nargs_spec = deque(nargs_spec)
    rv = []
    spos = None

    def _fetch(c):
        try:
            if spos is None:
                return c.popleft()
            else:
                return c.pop()
        except IndexError:
            return None

    while nargs_spec:
        nargs = _fetch(nargs_spec)
        if nargs == 1:
            rv.append(_fetch(args))
        elif nargs > 1:
            x = [_fetch(args) for _ in range(nargs)]
            # If we're reversed, we're pulling in the arguments in reverse,
            # so we need to turn them around.
            if spos is not None:
                x.reverse()
            rv.append(tuple(x))
        elif nargs < 0:
            if spos is not None:
                raise TypeError('Cannot have two nargs < 0')
            spos = len(rv)
            rv.append(None)

    # spos is the position of the wildcard (star).  If it's not `None`,
    # we fill it with the remainder.
    if spos is not None:
        rv[spos] = tuple(args)
        args = []
        rv[spos + 1:] = reversed(rv[spos + 1:])

    return tuple(rv), list(args)

_unpack_args(args=['foo.txt', 'bar.txt', 'dir'], nargs_spec=[-1, 1])

<function _unpack_args.<locals>._fetch at 0x7fe6e9431b80>


def SeparateFlagArgs(args: list):
  """Splits a list of args into those for Flags and those for Fire.

  If an isolated '--' arg is not present in the arg list, then all of the args
  are for Fire. If there is an isolated '--', then the args after the final '--'
  are flag args, and the rest of the args are fire args.

  Args:
    args: The list of arguments received by the Fire command.
  Returns:
    A tuple with the Fire args (a list), followed by the Flag args (a list).
  """
  if len(args) > 0 and (args[-1] == '-h' or args[-1] == '--help') and '--' not in args:
    args.pop()
    args.append('--')
    args.append('-h')

  if '--' in args:
    separator_index = len(args) - 1 - args[::-1].index('--')  # index of last --
    flag_args = args[separator_index + 1:]
    args = args[:separator_index]
    return args, flag_args

  return args, []

SeparateFlagArgs(args=['a', 'b', '--'])


def splitdrive(path):
    """
    Split the path into a pair (drive, tail) where drive is either a
    mount point or the empty string. On systems which do not use drive
    specifications, drive will always be the empty string.

    In all cases, drive + tail will be the same as path.

    Equivalent to "os.path.splitdrive".

    Args:
        path (path-like object): Path or URL.

    Returns:
        tuple of str: drive, tail.
    """
    relative = get_instance(path).relpath(path)
    drive = path.rsplit(relative, 1)[0]
    if drive and not drive[-2:] == '//':
        # Keep "/" tail side
        relative = '/' + relative
        drive = drive.rstrip('/')
    return drive, relative

splitdrive(path='dummy://dir1/dir2/dir3')


def _search_reference(filename, contents, strict=False):
  """Returns a match object if filename is referenced in contents, and None otherwise.

  If not strict mode, path prefix and extension are optional.
  """
  if strict:
    # regex pattern for strict=True for path/to/img.ext:
    # \{[\s%]*path/to/img\.ext[\s%]*\}
    filename_regex = filename.replace('.', r'\.')
  else:
    filename_path = Path(filename)

    # make extension optional
    root, extension = filename_path.stem, filename_path.suffix
    basename_regex = '{}({})?'.format(
        regex.escape(root), regex.escape(extension)
    )

    # iterate through parent fragments to make path prefix optional
    path_prefix_regex = ''
    for fragment in reversed(filename_path.parents):
      if fragment.name == '.':
        continue
      fragment = regex.escape(fragment.name)
      path_prefix_regex = '({}{}{})?'.format(
          path_prefix_regex, fragment, os.sep
      )

    # Regex pattern for strict=True for path/to/img.ext:
    # \{[\s%]*(<path_prefix>)?<basename>(<ext>)?[\s%]*\}
    filename_regex = path_prefix_regex + basename_regex

  # Some files 'path/to/file' are referenced in tex as './path/to/file' thus
  # adds prefix for relative paths starting with './' or '.\' to regex search.
  filename_regex = r'(.' + os.sep + r')?' + filename_regex

  # Pads with braces and optional whitespace/comment characters.
  patn = r'\{{[\s%]*{}[\s%]*\}}'.format(filename_regex)
  # Picture references in LaTeX are allowed to be in different cases.
  return regex.search(patn, contents, regex.IGNORECASE)

_search_reference(filename='to/img.ext', contents='{img.ext}', strict=False)

'{img.ext}'

'{img.ext}'


rs = pow(int(binascii.hexlify(text), 16), int(pubkey, 16), int(modulus, 16))


def _get_default_expanded_coordinate(shape, ndim):
    x_coords = []
    for i in range(ndim):
        idx = [None] * ndim
        idx[i] = slice(None, None, None)
        x_coords.append(np.arange(shape[i])[tuple(idx)])
    return x_coords

_get_default_expanded_coordinate(shape=array([102]), ndim=1)


def a1_to_rowcol(label):
    """Translates a cell's address in A1 notation to a tuple of integers.

    :param str label: A cell label in A1 notation, e.g. 'B1'.
        Letter case is ignored.
    :returns: a tuple containing `row` and `column` numbers. Both indexed
              from 1 (one).
    :rtype: tuple

    Example:

    >>> a1_to_rowcol('A1')
    (1, 1)

    """
    m = CELL_ADDR_RE.match(label)
    if m:
        column_label = m.group(1).upper()
        row = int(m.group(2))

        col = 0
        for i, c in enumerate(reversed(column_label)):
            col += (ord(c) - MAGIC_NUMBER) * (26**i)
    else:
        raise IncorrectCellLabel(label)

    return (row, col)

a1_to_rowcol(label='B1')

<re.Match object; span=(0, 2), match='B1'>


def unaliased(d, key, value):
            super(AliasDict, d).__setitem__(key, value)

unaliased(d={}, key='make-sudouser', value=<Task 'make_sudouser'>, __class__=<class 'invoke.vendor.lexicon.alias_dict.AliasDict'>)


def load_permissions(apilevel, permtype='permissions'):
    """
    Load the Permissions for the given apilevel.

    The permissions lists are generated using this tool: https://github.com/U039b/aosp_permissions_extraction

    Has a fallback to select the maximum or minimal available API level.
    For example, if 28 is requested but only 26 is available, 26 is returned.
    If 5 is requested but 16 is available, 16 is returned.

    If an API level is requested which is in between of two API levels we got,
    the lower level is returned. For example, if 5,6,7,10 is available and 8 is
    requested, 7 is returned instead.

    :param apilevel:  integer value of the API level
    :param permtype: either load permissions (:code:`'permissions'`) or
    permission groups (:code:`'groups'`)
    :return: a dictionary of {Permission Name: {Permission info}
    """

    if permtype not in ['permissions', 'groups']:
        raise ValueError("The type of permission list is not known.")

    # Usually apilevel is supplied as string...
    apilevel = int(apilevel)

    root = os.path.dirname(os.path.realpath(__file__))
    permissions_file = os.path.join(root, "aosp_permissions", "permissions_{}.json".format(apilevel))

    levels = filter(lambda x: re.match(r'^permissions_\d+\.json$', x), os.listdir(os.path.join(root, "aosp_permissions")))
    levels = list(map(lambda x: int(x[:-5].split('_')[1]), levels))

    if not levels:
        logger.error("No Permissions available, can not load!")
        return {}

    logger.debug("Available API levels: {}".format(", ".join(map(str, sorted(levels)))))

    if not os.path.isfile(permissions_file):
        if apilevel > max(levels):
            logger.warning("Requested API level {} is larger than maximum we have, returning API level {} instead.".format(apilevel, max(levels)))
            return load_permissions(max(levels), permtype)
        if apilevel < min(levels):
            logger.warning("Requested API level {} is smaller than minimal we have, returning API level {} instead.".format(apilevel, max(levels)))
            return load_permissions(min(levels), permtype)

        # Missing level between existing ones, return the lower level
        lower_level = max(filter(lambda x: x < apilevel, levels))
        logger.warning("Requested API Level could not be found, using {} instead".format(lower_level))
        return load_permissions(lower_level, permtype)

    with open(permissions_file, "r") as fp:
        return json.load(fp)[permtype]

load_permissions(apilevel='25', permtype='permissions')


def _readCharVec(fp: BinaryIO, itemsize:int=None, dtype=None, size:tuple=None, use_unicode=is_unicode):
        """

        :param fp:
        :param itemsize:
        :param dtype:
        :param size:
        :param is_unicode:
        :return:
        """

        array = np.chararray(size, itemsize=itemsize, unicode=use_unicode)
        Clen = array.itemsize

        if "<U" in str(dtype):
            Clen = Clen // 4

        MaxEntry = size[0]
        NRec = 100
        ndata = 0
        dataFormStart = '=4siii'

        while NRec > 1:
            nbyte = HarFileIO._getEntrySize(fp)

            V = HarFileIO._unpack_data(fp, dataFormStart)

            if fb(V[0]) != '    ':
                raise IOError("Encountered characters at first four positions")

            NRec = V[1]
            if V[2] != MaxEntry:
                raise ValueError("Different Size than specified")

            if ndata + V[3] > MaxEntry:
                raise RuntimeError("More data on Header than declared")

            AllStr = fb(fp.read(V[3] * Clen))

            if nbyte != HarFileIO._getEntrySize(fp):
                raise IOError("I/O Error: sizes on 1C header do not match record length")

            for j, i in enumerate(range(0, V[3] * Clen, Clen)):
                array[ndata + j] = AllStr[i:i + Clen]
            ndata += V[3]

        return np.ascontiguousarray(array)

_readCharVec(fp=<_io.BufferedReader name='/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/GEMPACKsoftware+HARPY/GEMPACKsoftware+HARPY/test_remove_header_array.har'>, itemsize=70, dtype='<U12', size=(1,), use_unicode=True)


def replace_most_similar_chunk(whole, part, replace):
    """Best efforts to find the `part` lines in `whole` and replace them with `replace`"""

    whole, whole_lines = prep(whole)
    part, part_lines = prep(part)
    replace, replace_lines = prep(replace)

    res = perfect_or_whitespace(whole_lines, part_lines, replace_lines)
    if res:
        return res

    # drop leading empty line, GPT sometimes adds them spuriously (issue #25)
    if len(part_lines) > 2 and not part_lines[0].strip():
        skip_blank_line_part_lines = part_lines[1:]
        res = perfect_or_whitespace(whole_lines, skip_blank_line_part_lines, replace_lines)
        if res:
            return res

    # Try to handle when it elides code with ...
    try:
        res = try_dotdotdots(whole, part, replace)
        if res:
            return res
    except ValueError:
        pass

    return
    # Try fuzzy matching
    res = replace_closest_edit_distance(whole_lines, part, part_lines, replace_lines)
    if res:
        return res

replace_most_similar_chunk(whole='two\n', part='two\n', replace='three\n')


def fill_gaps(L, rows=None, cols=None, padding_value=""):
    """Fill gaps in a list of lists.
    e.g.,::

        >>> L = [
        ... [1, 2, 3],
        ... ]
        >>> fill_gaps(L, 2, 4)
        [
            [1, 2, 3, ""],
            ["", "", "", ""]
        ]

    :param L: List of lists to fill gaps in.
    :param rows: Number of rows to fill.
    :param cols: Number of columns to fill.
    :param padding_value: Default value to fill gaps with.

    :type L: list[list[T]]
    :type rows: int
    :type cols: int
    :type padding_value: T

    :return: List of lists with gaps filled.
    :rtype: list[list[T]]:
    """
    try:
        max_cols = max(len(row) for row in L) if cols is None else cols
        max_rows = len(L) if rows is None else rows

        pad_rows = max_rows - len(L)

        if pad_rows:
            L = L + ([[]] * pad_rows)

        return [rightpad(row, max_cols, padding_value=padding_value) for row in L]
    except ValueError:
        return []

fill_gaps(L=[['', 'Dummy']], rows=None, cols=None, padding_value='')


def _readREFullObj(fp, array, dtype):

        nbyte = HarFileIO._getEntrySize(fp)
        dataForm = '=4sii'

        V = HarFileIO._unpack_data(fp, dataForm)

        if fb(V[0]) != '    ':
            raise Exception("Encountered characters at read7D[1]")

        nrec = V[1]
        NDim = V[2]
        dataForm = "=" + ('i' * NDim)

        V = HarFileIO._unpack_data(fp, dataForm)

        if nbyte != HarFileIO._getEntrySize(fp):
            raise RuntimeError("Header corrupted read7D[0] @ %d" % fp.tell())

        oldshape = array.shape
        array = array.flatten('F')
        idata = 0
        while nrec > 1:
            nbyte = HarFileIO._getEntrySize(fp)
            dataForm = '4s15i'
            V = HarFileIO._unpack_data(fp, dataForm)

            if fb(V[0]) != '    ':
                raise RuntimeError("Encountered characters at first four positions at)SetEl")

            if nbyte != HarFileIO._getEntrySize(fp):
                raise RuntimeError('read7D data[2] corrupted')

            nbyte = HarFileIO._getEntrySize(fp)
            ndata = (nbyte - 8) // struct.calcsize(dtype)
            dataForm = '4si' + str(ndata) + dtype
            V = HarFileIO._unpack_data(fp, dataForm)

            if nbyte != HarFileIO._getEntrySize(fp):
                raise RuntimeError('read7D data[2])corrupted')

            if fb(V[0]) != '    ':
                raise RuntimeError("Encountered characters at read7D[2]")

            nrec = V[1]
            array[idata:idata + ndata] = V[2:]
            idata += ndata
        array = array.reshape(oldshape, order='F')
        return array

_readREFullObj(fp=<_io.BufferedReader name='/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/GEMPACKsoftware+HARPY/GEMPACKsoftware+HARPY/test_remove_header_array.har'>, array=array([[0., 0.],       [0., 0.]], dtype=float32), dtype='f')


def _unpack_data(fp, form, data=''):
        """
        :param fp:
        :param form:
        :param data:
        :return:
        """
        # print("HarFileIO._unpack_data() form, data ", form, data)
        if not data:
            data = fp.read(struct.calcsize(form))
        return struct.unpack(form, data[0:struct.calcsize(form)])

_unpack_data(fp=<_io.BufferedReader name='test_remove_header_array.har'>, form='=4s2s4s70si', data='')

b'    1CFULLCreation Date and Time                                                \x02\x00\x00\x00'


def clasifier(optimizer):
    X, y = make_classification(
        n_samples=1000, n_features=100, n_informative=75, random_state=1111, n_classes=2, class_sep=2.5
    )
    y = one_hot(y)

    X -= np.mean(X, axis=0)
    X /= np.std(X, axis=0)
    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.15, random_state=1111)

    model = NeuralNet(
        layers=[
            Dense(128, Parameters(init="uniform")),
            Activation("relu"),
            Dropout(0.5),
            Dense(64, Parameters(init="normal")),
            Activation("relu"),
            Dense(2),
            Activation("softmax"),
        ],
        loss="categorical_crossentropy",
        optimizer=optimizer,
        metric="accuracy",
        batch_size=64,
        max_epochs=10,
    )
    model.fit(X_train, y_train)
    predictions = model.predict(X_test)
    return roc_auc_score(y_test[:, 0], predictions[:, 0])

clasifier(optimizer={rho=0.95, eps=1e-08, lr=1.0})


def call_on_comment(*args, **kwargs):
    global events
    repo_full_name = kwargs["repo_full_name"]
    pr_id = kwargs["pr_number"]
    key = f"{repo_full_name}-{pr_id}"

    # Check if a previous process exists for the same key, cancel it
    thread = events.get(key, None)
    if thread:
        terminate_thread(thread)

    thread = threading.Thread(target=run_comment, args=args, kwargs=kwargs)
    events[key] = thread
    thread.start()

call_on_comment(args=(), kwargs={'repo_full_name': 'exampleRepo', 'pr_number': 1})


def generate_k(order, secexp, hash_func, data, retry_gen=0, extra_entropy=b''):
    '''
        order - order of the DSA generator used in the signature
        secexp - secure exponent (private key) in numeric form
        hash_func - reference to the same hash function used for generating hash
        data - hash in binary form of the signing data
        retry_gen - int - how many good 'k' values to skip before returning
        extra_entropy - extra added data in binary form as per section-3.6 of
            rfc6979
    '''

    qlen = bit_length(order)
    holen = hash_func().digest_size
    rolen = (qlen + 7) / 8
    bx = number_to_string(secexp, order) + bits2octets(data, order) + \
        extra_entropy

    # Step B
    v = b'\x01' * holen

    # Step C
    k = b'\x00' * holen

    # Step D

    k = hmac.new(k, v + b'\x00' + bx, hash_func).digest()

    # Step E
    v = hmac.new(k, v, hash_func).digest()

    # Step F
    k = hmac.new(k, v + b'\x01' + bx, hash_func).digest()

    # Step G
    v = hmac.new(k, v, hash_func).digest()

    # Step H
    while True:
        # Step H1
        t = b''

        # Step H2
        while len(t) < rolen:
            v = hmac.new(k, v, hash_func).digest()
            t += v

        # Step H3
        secret = bits2int(t, qlen)

        if secret >= 1 and secret < order:
            if retry_gen <= 0:
                return secret
            else:
                retry_gen -= 1

        k = hmac.new(k, v + b'\x00', hash_func).digest()
        v = hmac.new(k, v, hash_func).digest()

generate_k(order=115792089237316195423570985008687907852837564279074904382605163141518161494337, secexp=11806252235961651298089590628336806290921645495320214372650577192963691649562, hash_func=<built-in function openssl_sha256>, data=b'\xa7?\xcf3\x96@\x92\x92\x07(\x1f\xb8\xe08\x88H\x06\xe2\xeb\x08@\xf2$V\x94\xdb\xba\x1d\\\xc8\x9ee', retry_gen=0, extra_entropy=b'')


def fmt_dtype(hdf_dt):
    """Get a (preferably short) string describing an HDF5 datatype"""
    size = hdf_dt.get_size()

    if isinstance(hdf_dt, h5t.TypeIntegerID):
        # Check normal int & uint dtypes first
        for candidate, descr in int_types_by_size().get(size, ()):
            if hdf_dt == candidate:
                return descr
        un = 'un' if hdf_dt.get_sign() == h5t.SGN_NONE else ''
        return "{}-byte {}signed integer".format(size, un)
    elif isinstance(hdf_dt, h5t.TypeFloatID):
        # Check normal float dtypes first
        for candidate, descr in float_types_by_size().get(size, ()):
            if hdf_dt == candidate:
                return descr
        return "custom {}-byte float".format(size)
    elif isinstance(hdf_dt, h5t.TypeBitfieldID):
        return "{}-byte bitfield".format(size)
    elif isinstance(hdf_dt, h5t.TypeTimeID):
        return "time"  # NB. time datatype is deprecated
    elif isinstance(hdf_dt, h5t.TypeOpaqueID):
        s = "{}-byte opaque".format(size)
        tag = hdf_dt.get_tag()
        if tag:
            s += ' ({})'.format(tag.decode('utf-8', 'replace'))
        return s
    elif isinstance(hdf_dt, h5t.TypeStringID):
        cset = cset_names.get(hdf_dt.get_cset(), '?cset')
        if hdf_dt.is_variable_str():
            return "{} string".format(cset)
        else:
            return "{}-byte {} string".format(size, cset)
    elif isinstance(hdf_dt, h5t.TypeVlenID):
        return "vlen array of " + fmt_dtype(hdf_dt.get_super())
    elif isinstance(hdf_dt, h5t.TypeArrayID):
        shape = fmt_shape(hdf_dt.get_array_dims())
        return "{} array of {}".format(shape, fmt_dtype(hdf_dt.get_super()))

    elif isinstance(hdf_dt, h5t.TypeCompoundID):
        return "({})".format(", ".join(
            "{}: {}".format(
                hdf_dt.get_member_name(i).decode('utf-8', 'replace'),
                fmt_dtype(hdf_dt.get_member_type(i))
            )
            for i in range(hdf_dt.get_nmembers())
        ))
    elif isinstance(hdf_dt, h5t.TypeEnumID):
        nmembers = hdf_dt.get_nmembers()
        if nmembers >= 5:
            return "enum ({} options)".format(nmembers)
        else:
            return "enum ({})".format(", ".join(
                hdf_dt.get_member_name(i).decode('utf-8', 'replace')
                for i in range(nmembers)
            ))
    elif isinstance(hdf_dt, h5t.TypeReferenceID):
        return "region ref" if hdf_dt == h5t.STD_REF_DSETREG else "object ref"

    return "unrecognised {}-byte datatype".format(size)

fmt_dtype(hdf_dt=REPR FAILED)


def prepare_docstring_help(N):
    """Replace docstrings to include the parameters (schema)"""
    # at this point, the params have not yet been populated

    args = []
    if hasattr(N, '__annotations__'):
        for attr_name, cls in N.__annotations__.items():

            filtered = filter_params(N)
            parsed = parse_source_for_params(filtered)
            attr = attr_map(parsed).get(attr_name)
            if attr is None:
                continue

            args.append(argument_help(attr_name, attr))

    return '\n'.join(args)

prepare_docstring_help(N={})

{'type': 'int', 'default': '0', 'description': ''}


def det_hess(u):
    """
    Get the determinant of the Hessian matrix of `u`.

    Parameters
    ----------
    * `u` : numpy.ndarray
        The ndarray input with shape (n0+2, n1+2, ..., nd1+2).

    Returns
    -------
    * numpy.ndarray
        The ndarray of the second grad of `u` with shape (n0, n1, ..., nd1).
    """
    ndim = np.ndim(u)
    inshape = np.asarray(u.shape)
    outshape = list(inshape - 2)

    # obtain the second gradient per each pairs of axes
    hess_unarranged = np.zeros([ndim, ndim] + outshape)
    for i in range(ndim):
        for j in range(i,ndim):
            grad2_val = grad2(u, (i,j))
            hess_unarranged[i,j] = grad2_val
            hess_unarranged[j,i] = grad2_val

    # rearrange hessian to have shape: outshape + [ndim, ndim]
    perm_idx = list(range(2,ndim+2)) + list(range(2))
    hess = np.transpose(hess_unarranged, perm_idx)

    # calculate and return the determinant
    return np.linalg.det(hess)

det_hess(u=array([  0.,   1.,   4.,   9.,  16.,  25.,  36.,  49.,  64.,  81., 100.,       121., 144., 169., 196., 225., 256., 289., 324., 361., 400., 441.,       484., 529., 576., 625., 676., 729., 784., 841., 900., 961.]))


k = hmac.new(k, v + b'\x00' + bx, hash_func).digest()


def _solequal(sol1, sol2, prec):
    """
    Compare two different solutions with a given precicion.

    Return True if they equal.
    """
    res = True

    for sol_1, sol_2 in zip(sol1, sol2):
        if np.ndim(sol_1) != 0 and np.ndim(sol_2) != 0:
            res &= _dist(sol_1, sol_2) < prec
        elif np.ndim(sol_1) != 0 and np.ndim(sol_2) == 0:
            return False
        elif np.ndim(sol_1) == 0 and np.ndim(sol_2) != 0:
            return False

    return res

_solequal(sol1=[array([0., 0.]), array([3., 0.]), array([3.5       , 1.93649167]), array([ 0.16666667, -0.9860133 ])], sol2=[array([0., 0.]), array([3., 0.]), array([3.5       , 1.93649167]), array([0.16666667, 0.9860133 ])], prec=0.1)


def deep_extend(*args):
        """
        Deep copy of each item ("extend" makes swallow copy!)
        """
        def clone_obj(item):
            if isinstance(item, dict):
                return dict(**item)
            if isinstance(item, (list, tuple)):
                return list(item)
            return None

        def iterator(item, i, iterable):
            obj = clone_obj(item)
            if obj is None:
                iterable[i] = item
            else:
                if isinstance(obj, dict):
                    iterable[i] = deep_extend({}, obj)
                elif isinstance(obj, (list, tuple)):
                    FuncFlow.each(obj, iterator)
                    iterable[i] = obj
                else:
                    raise TypeError("deep_copy cannot handle this type: {}".format(type(obj)))

        args = list(args)
        dest = args.pop(0)

        for source in args:
            if source:
                for k, v in source.items():
                    obj = clone_obj(v)
                    if obj is None:
                        dest[k] = v
                    else:
                        FuncFlow.each(obj, iterator)
                        dest[k] = obj
        return dest

deep_extend(args=(2,))

<function FuncFlow.deep_extend.<locals>.clone_obj at 0x7f4e6dc12d30>

<function FuncFlow.deep_extend.<locals>.iterator at 0x7f4e6dc12c10>


def _readSetElementInfoRecord(fp):

        SetNames = []
        ElementList = []
        SetStatus = []

        nbyte = HarFileIO._getEntrySize(fp)

        # read the data, has to be in chunks as it is dependent on interanl size specifications
        dataForm = '=' + '4siii12si'

        V = HarFileIO._unpack_data(fp, dataForm)

        if fb(V[0]) != '    ':
            raise RuntimeError("Encountered characters at first four positions at SetEl")

        NSets = V[3]
        Coefficient = fb(V[4])
        setKnown=V[5]!=0
        if not setKnown:
            dataForm = '=i'
        else:
            dataForm = "=" + str(NSets * 12) + 's' + str(NSets) + 's' + str(NSets) + 'i' + 'i'

        V = HarFileIO._unpack_data(fp, dataForm)
        if setKnown:
            SetNames = [fb(V[0][i:i + 12]) for i in range(0, NSets * 12, 12)]
            SetStatus = [fb(V[1][i:i + 1]) for i in range(0, NSets)]

        Nexplicit = V[-1]
        dataForm = '=' + str(Nexplicit * 12) + 's'
        V = HarFileIO._unpack_data(fp, dataForm)

        if Nexplicit > 0:
            dataForm = '=' + str(Nexplicit * 12) + 's'
            V = HarFileIO._unpack_data(fp, dataForm)

            ElementList = [fb(V[-1][i:i + 12]) for i in range(0, NSets * 12, 12)]

        HarFileIO._checkRead(fp, nbyte)

        return Coefficient, SetNames, SetStatus, ElementList

_readSetElementInfoRecord(fp=<_io.BufferedReader name='/local/rcs/XXX/code/pytrace-collector/logs/pypibugs/tried/GEMPACKsoftware+HARPY/GEMPACKsoftware+HARPY/test_remove_header_array.har'>)

(b'SimpleSet   SimpleSet2  ', b'kk', 0, 0, 0)


def delete(self, *, ip_parameter, cascade):

        as_address = clean_address(ip_parameter)
        as_network = clean_network(ip_parameter)

        if as_address in self.__description:
            return self.__remove_ip_object(as_address)
        elif as_network in self.__description:
            return self.__remove_ip_object(as_network)

        raise IPObjectNotInSpaceError("cannot delete undescribed IP object")

delete(self=AddressSpace(_AddressSpace__strict=False, _AddressSpace__description={IPv4Address('203.0.113.128'): 'an IPv4 test net address'}, _AddressSpace__networks={}, _AddressSpace__addresses={4: {IPv4Address('203.0.113.128')}}, _AddressSpace__parent_supernet={IPv4Address('203.0.113.128'): None}, _AddressSpace__children_ip_object={None: {IPv4Address('203.0.113.128')}}), ip_parameter='203.0.113.128', cascade=True, self._AddressSpace__addresses={4: {IPv4Address('203.0.113.128')}}, self._AddressSpace__children_ip_object={None: {IPv4Address('203.0.113.128')}}, self._AddressSpace__description={IPv4Address('203.0.113.128'): 'an IPv4 test net address'}, self._AddressSpace__networks={}, self._AddressSpace__parent_supernet={IPv4Address('203.0.113.128'): None}, self._AddressSpace__strict=False)

AddressSpace(_AddressSpace__strict=False, _AddressSpace__description={}, _AddressSpace__networks={}, _AddressSpace__addresses={4: {IPv4Address('203.0.113.128')}}, _AddressSpace__parent_supernet={}, _AddressSpace__children_ip_object={None: set()})


{'type': 'int', 'default': '0', 'description': ''}


def apply_env_options():
    "apply options passed through environment variables"
    env_options = filter(is_flower_envvar, os.environ)
    for env_var_name in env_options:
        name = env_var_name.replace(ENV_VAR_PREFIX, '', 1).lower()
        value = os.environ[env_var_name]
        try:
            option = options._options[name]  # pylint: disable=protected-access
        except KeyError:
            option = options._options[name.replace('_', '-')]  # pylint: disable=protected-access
        if option.multiple:
            value = [option.type(i) for i in value.split(',')]
        else:
            if option.type is bool:
                value = bool(strtobool(value))
            else:
                value = option.type(value)
        setattr(options, name, value)

apply_env_options()

{name='auto_refresh', help='refresh workerss', metavar=None, multiple=False, file_name='/local/rcs/XXX/code/pytrace-collector/logs/self_collected/tried/mher+flower/mher+flower/flower/options.py', group_name='/local/rcs/XXX/code/pytrace-collector/logs/self_collected/tried/mher+flower/mher+flower/flower/options.py', callback=None, default=True, _value=<object object at 0x7fc8330cff40>}

{name='auto_refresh', help='refresh workerss', metavar=None, multiple=False, file_name='/local/rcs/XXX/code/pytrace-collector/logs/self_collected/tried/mher+flower/mher+flower/flower/options.py', group_name='/local/rcs/XXX/code/pytrace-collector/logs/self_collected/tried/mher+flower/mher+flower/flower/options.py', callback=None, default=True, _value=False}


def _a1_to_rowcol_unbounded(label):
    """Translates a cell's address in A1 notation to a tuple of integers.

    Same as `a1_to_rowcol()` but allows for missing row or column part
    (e.g. "A" for the first column)

    :returns: a tuple containing `row` and `column` numbers. Both indexed
        from 1 (one).
    :rtype: tuple

    Example:

    >>> _a1_to_rowcol_unbounded('A1')
    (1, 1)

    >>> _a1_to_rowcol_unbounded('A')
    (inf, 1)

    >>> _a1_to_rowcol_unbounded('1')
    (1, inf)

    >>> _a1_to_rowcol_unbounded('ABC123')
    (123, 731)

    >>> _a1_to_rowcol_unbounded('ABC')
    (inf, 731)

    >>> _a1_to_rowcol_unbounded('123')
    (123, inf)

    >>> _a1_to_rowcol_unbounded('1A')
    Traceback (most recent call last):
        ...
    gspread.exceptions.IncorrectCellLabel: 1A

    >>> _a1_to_rowcol_unbounded('')
    (inf, inf)

    """
    m = A1_ADDR_ROW_COL_RE.match(label)
    if m:
        column_label, row = m.groups()

        if column_label:
            col = 0
            for i, c in enumerate(reversed(column_label.upper())):
                col += (ord(c) - MAGIC_NUMBER) * (26**i)
        else:
            col = inf

        if row:
            row = int(row)
        else:
            row = inf
    else:
        raise IncorrectCellLabel(label)

    return (row, col)

_a1_to_rowcol_unbounded(label='A1')

<re.Match object; span=(0, 2), match='A1'>