1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
Ë
KñúhȃãóØ—gd¢ZddlZddlZddlZddlmZddlmZddlm    Z    ddl
m Z m Z m Z eje    jd¬    «Zd
„Zee«d „«Zd „Zee«d „«Zd„Zee«d„«Zd„Zdddœd„Zee«dddœd„«Zee«dddœd„«Zd(dddœd„Zee«d)dddœd„«Zddœd„Zee«ddœd„«Zeej>dej>«Z eejBdejB«Z"eejFdejF«Z$d„Z%gfd„Z&d„Z'd„Z(d „Z)d*d!„Z*d*d"„Z+d#„Z,ee,«d$„«Z-d%„Z.d&„Z/d'„Z0y)+)Ú
atleast_1dÚ
atleast_2dÚ
atleast_3dÚblockÚhstackÚstackÚunstackÚvstackéNé)Ú fromnumeric)Únumeric)Ú    overrides)ÚarrayÚ
asanyarrayÚnormalize_axis_indexÚnumpy)Úmodulecó—|S©N©©Úaryss úIH:\Change_password\venv_build\Lib\site-packages\numpy/_core/shape_base.pyÚ_atleast_1d_dispatcherró€Ø €Kócó—t|«dk(r0t|d«}|jdk(r|jd«}|Sg}|D]>}t|«}|jdk(r|jd«}|j    |«Œ@t |«S)a7
    Convert inputs to arrays with at least one dimension.
 
    Scalar inputs are converted to 1-dimensional arrays, whilst
    higher-dimensional inputs are preserved.
 
    Parameters
    ----------
    arys1, arys2, ... : array_like
        One or more input arrays.
 
    Returns
    -------
    ret : ndarray
        An array, or tuple of arrays, each with ``a.ndim >= 1``.
        Copies are made only if necessary.
 
    See Also
    --------
    atleast_2d, atleast_3d
 
    Examples
    --------
    >>> import numpy as np
    >>> np.atleast_1d(1.0)
    array([1.])
 
    >>> x = np.arange(9.0).reshape(3,3)
    >>> np.atleast_1d(x)
    array([[0., 1., 2.],
           [3., 4., 5.],
           [6., 7., 8.]])
    >>> np.atleast_1d(x) is x
    True
 
    >>> np.atleast_1d(1, [3, 4])
    (array([1]), array([3, 4]))
 
    r r
)ÚlenrÚndimÚreshapeÚappendÚtuple)rÚresultÚresÚarys    rrrsŒ€ôR ˆ4ƒyA‚~ܘD ™GÓ$ˆØ ;‰;˜!Ò Ø—^‘^ AÓ&ˆF؈ Ø
€CØòˆÜ˜C“ˆØ ;‰;˜!Ò Ø—^‘^ AÓ&ˆFØ 
‰
6Õð    ô
‹:Ðrcó—|Srrrs rÚ_atleast_2d_dispatcherr'Lrrcó—g}|D]i}t|«}|jdk(r|jdd«}n)|jdk(r|tjdd…f}n|}|j |«Œkt |«dk(r|dSt|«S)ax
    View inputs as arrays with at least two dimensions.
 
    Parameters
    ----------
    arys1, arys2, ... : array_like
        One or more array-like sequences.  Non-array inputs are converted
        to arrays.  Arrays that already have two or more dimensions are
        preserved.
 
    Returns
    -------
    res, res2, ... : ndarray
        An array, or tuple of arrays, each with ``a.ndim >= 2``.
        Copies are avoided where possible, and views with two or more
        dimensions are returned.
 
    See Also
    --------
    atleast_1d, atleast_3d
 
    Examples
    --------
    >>> import numpy as np
    >>> np.atleast_2d(3.0)
    array([[3.]])
 
    >>> x = np.arange(3.0)
    >>> np.atleast_2d(x)
    array([[0., 1., 2.]])
    >>> np.atleast_2d(x).base is x
    True
 
    >>> np.atleast_2d(1, [1, 2], [[1, 2]])
    (array([[1]]), array([[1, 2]]), array([[1, 2]]))
 
    r
r N©rrr Ú_nxÚnewaxisr!rr"©rr$r%r#s    rrrPs‹€ðN €CØòˆÜ˜‹oˆØ 8‰8qŠ=Ø—[‘[  AÓ&‰FØ X‰X˜Š]ØœŸ™¢a˜Ñ(‰FàˆFØ 
‰
6Õðô ˆ3ƒx1‚}ؐ1‰vˆ äS‹zÐrcó—|Srrrs rÚ_atleast_3d_dispatcherr.‡rrcó’—g}|D]£}t|«}|jdk(r|jddd«}nb|jdk(r'|tjdd…tjf}n,|jdk(r|dd…dd…tjf}n|}|j |«Œ¥t |«dk(r|dSt|«S)a
    View inputs as arrays with at least three dimensions.
 
    Parameters
    ----------
    arys1, arys2, ... : array_like
        One or more array-like sequences.  Non-array inputs are converted to
        arrays.  Arrays that already have three or more dimensions are
        preserved.
 
    Returns
    -------
    res1, res2, ... : ndarray
        An array, or tuple of arrays, each with ``a.ndim >= 3``.  Copies are
        avoided where possible, and views with three or more dimensions are
        returned.  For example, a 1-D array of shape ``(N,)`` becomes a view
        of shape ``(1, N, 1)``, and a 2-D array of shape ``(M, N)`` becomes a
        view of shape ``(M, N, 1)``.
 
    See Also
    --------
    atleast_1d, atleast_2d
 
    Examples
    --------
    >>> import numpy as np
    >>> np.atleast_3d(3.0)
    array([[[3.]]])
 
    >>> x = np.arange(3.0)
    >>> np.atleast_3d(x).shape
    (1, 3, 1)
 
    >>> x = np.arange(12.0).reshape(4,3)
    >>> np.atleast_3d(x).shape
    (4, 3, 1)
    >>> np.atleast_3d(x).base is x.base  # x is a reshape, so not base itself
    True
 
    >>> for arr in np.atleast_3d([1, 2], [[1, 2]], [[[1, 2]]]):
    ...     print(arr, arr.shape) # doctest: +SKIP
    ...
    [[[1]
      [2]]] (1, 2, 1)
    [[[1]
      [2]]] (1, 2, 1)
    [[[1 2]]] (1, 1, 2)
 
    r
r Nér)r,s    rrr‹s´€ðf €CØò
ˆÜ˜‹oˆØ 8‰8qŠ=Ø—[‘[  A qÓ)‰FØ X‰X˜Š]ØœŸ™¢a¬¯©Ð4Ñ5‰FØ X‰X˜Š]ØššAœsŸ{™{Ð*Ñ+‰FàˆFØ 
‰
6Õð
ô ˆ3ƒx1‚}ؐ1‰vˆ äS‹zÐrcóF—t|d«s td«‚t|«S)NÚ __getitem__zJarrays to stack must be passed as a "sequence" type such as list or tuple.)ÚhasattrÚ    TypeErrorr")Úarrayss rÚ_arrays_for_stack_dispatcherr6Ðs*€Ü 6˜=Ô )Üð1ó2ð    2ô ‹=Ðr©ÚdtypeÚcastingcó—t|«Sr)r6)Útupr8r9s   rÚ_vhstack_dispatcherr<Øs €Ü '¨Ó ,Ð,rÚ    same_kindcój—t|Ž}t|t«s|f}tj|d||¬«S)a     
    Stack arrays in sequence vertically (row wise).
 
    This is equivalent to concatenation along the first axis after 1-D arrays
    of shape `(N,)` have been reshaped to `(1,N)`. Rebuilds arrays divided by
    `vsplit`.
 
    This function makes most sense for arrays with up to 3 dimensions. For
    instance, for pixel-data with a height (first axis), width (second axis),
    and r/g/b channels (third axis). The functions `concatenate`, `stack` and
    `block` provide more general stacking and concatenation operations.
 
    Parameters
    ----------
    tup : sequence of ndarrays
        The arrays must have the same shape along all but the first axis.
        1-D arrays must have the same length. In the case of a single
        array_like input, it will be treated as a sequence of arrays; i.e.,
        each element along the zeroth axis is treated as a separate array.
 
    dtype : str or dtype
        If provided, the destination array will have this dtype. Cannot be
        provided together with `out`.
 
        .. versionadded:: 1.24
 
    casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
        Controls what kind of data casting may occur. Defaults to 'same_kind'.
 
        .. versionadded:: 1.24
 
    Returns
    -------
    stacked : ndarray
        The array formed by stacking the given arrays, will be at least 2-D.
 
    See Also
    --------
    concatenate : Join a sequence of arrays along an existing axis.
    stack : Join a sequence of arrays along a new axis.
    block : Assemble an nd-array from nested lists of blocks.
    hstack : Stack arrays in sequence horizontally (column wise).
    dstack : Stack arrays in sequence depth wise (along third axis).
    column_stack : Stack 1-D arrays as columns into a 2-D array.
    vsplit : Split an array into multiple sub-arrays vertically (row-wise).
    unstack : Split an array into a tuple of sub-arrays along an axis.
 
    Examples
    --------
    >>> import numpy as np
    >>> a = np.array([1, 2, 3])
    >>> b = np.array([4, 5, 6])
    >>> np.vstack((a,b))
    array([[1, 2, 3],
           [4, 5, 6]])
 
    >>> a = np.array([[1], [2], [3]])
    >>> b = np.array([[4], [5], [6]])
    >>> np.vstack((a,b))
    array([[1],
           [2],
           [3],
           [4],
           [5],
           [6]])
 
    r
r7)rÚ
isinstancer"r*Ú concatenate©r;r8r9Úarrss    rr    r    Üs5€ôJ sÐ €DÜ dœEÔ "؈wˆÜ ?‰?˜4 ¨%¸Ô AÐArcóėt|Ž}t|t«s|f}|r+|djdk(rt    j
|d||¬«St    j
|d||¬«S)aÒ
    Stack arrays in sequence horizontally (column wise).
 
    This is equivalent to concatenation along the second axis, except for 1-D
    arrays where it concatenates along the first axis. Rebuilds arrays divided
    by `hsplit`.
 
    This function makes most sense for arrays with up to 3 dimensions. For
    instance, for pixel-data with a height (first axis), width (second axis),
    and r/g/b channels (third axis). The functions `concatenate`, `stack` and
    `block` provide more general stacking and concatenation operations.
 
    Parameters
    ----------
    tup : sequence of ndarrays
        The arrays must have the same shape along all but the second axis,
        except 1-D arrays which can be any length. In the case of a single
        array_like input, it will be treated as a sequence of arrays; i.e.,
        each element along the zeroth axis is treated as a separate array.
 
    dtype : str or dtype
        If provided, the destination array will have this dtype. Cannot be
        provided together with `out`.
 
        .. versionadded:: 1.24
 
    casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
        Controls what kind of data casting may occur. Defaults to 'same_kind'.
 
        .. versionadded:: 1.24
 
    Returns
    -------
    stacked : ndarray
        The array formed by stacking the given arrays.
 
    See Also
    --------
    concatenate : Join a sequence of arrays along an existing axis.
    stack : Join a sequence of arrays along a new axis.
    block : Assemble an nd-array from nested lists of blocks.
    vstack : Stack arrays in sequence vertically (row wise).
    dstack : Stack arrays in sequence depth wise (along third axis).
    column_stack : Stack 1-D arrays as columns into a 2-D array.
    hsplit : Split an array into multiple sub-arrays
             horizontally (column-wise).
    unstack : Split an array into a tuple of sub-arrays along an axis.
 
    Examples
    --------
    >>> import numpy as np
    >>> a = np.array((1,2,3))
    >>> b = np.array((4,5,6))
    >>> np.hstack((a,b))
    array([1, 2, 3, 4, 5, 6])
    >>> a = np.array([[1],[2],[3]])
    >>> b = np.array([[4],[5],[6]])
    >>> np.hstack((a,b))
    array([[1, 4],
           [2, 5],
           [3, 6]])
 
    r
r r7)rr?r"rr*r@rAs    rrr's\€ôB sÐ €DÜ dœEÔ "؈wˆá Q‘— ‘  Ò!܏‰˜t Q¨e¸WÔEÐE䏉˜t Q¨e¸WÔEÐErcóX—t|«}|t|«}|j|«|Sr)r6Úlistr!)r5ÚaxisÚoutr8r9s     rÚ_stack_dispatcherrHrs+€ä )¨&Ó 1€FØ
€äf“ˆØ ‰ cÔØ €Mrcó¤—|Dcgc] }t|«‘Œ}}|s td«‚|Dchc]}|j’Œ}}t|«dk7r td«‚|djdz}t ||«}t d«f|ztjfz}|Dcgc]}||‘Œ    }    }tj|    ||||¬«Scc}wcc}wcc}w)a—
    Join a sequence of arrays along a new axis.
 
    The ``axis`` parameter specifies the index of the new axis in the
    dimensions of the result. For example, if ``axis=0`` it will be the first
    dimension and if ``axis=-1`` it will be the last dimension.
 
    Parameters
    ----------
    arrays : sequence of ndarrays
        Each array must have the same shape. In the case of a single ndarray
        array_like input, it will be treated as a sequence of arrays; i.e.,
        each element along the zeroth axis is treated as a separate array.
 
    axis : int, optional
        The axis in the result array along which the input arrays are stacked.
 
    out : ndarray, optional
        If provided, the destination to place the result. The shape must be
        correct, matching that of what stack would have returned if no
        out argument were specified.
 
    dtype : str or dtype
        If provided, the destination array will have this dtype. Cannot be
        provided together with `out`.
 
        .. versionadded:: 1.24
 
    casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'}, optional
        Controls what kind of data casting may occur. Defaults to 'same_kind'.
 
        .. versionadded:: 1.24
 
 
    Returns
    -------
    stacked : ndarray
        The stacked array has one more dimension than the input arrays.
 
    See Also
    --------
    concatenate : Join a sequence of arrays along an existing axis.
    block : Assemble an nd-array from nested lists of blocks.
    split : Split array into a list of multiple sub-arrays of equal size.
    unstack : Split an array into a tuple of sub-arrays along an axis.
 
    Examples
    --------
    >>> import numpy as np
    >>> rng = np.random.default_rng()
    >>> arrays = [rng.normal(size=(3,4)) for _ in range(10)]
    >>> np.stack(arrays, axis=0).shape
    (10, 3, 4)
 
    >>> np.stack(arrays, axis=1).shape
    (3, 10, 4)
 
    >>> np.stack(arrays, axis=2).shape
    (3, 4, 10)
 
    >>> a = np.array([1, 2, 3])
    >>> b = np.array([4, 5, 6])
    >>> np.stack((a, b))
    array([[1, 2, 3],
           [4, 5, 6]])
 
    >>> np.stack((a, b), axis=-1)
    array([[1, 4],
           [2, 5],
           [3, 6]])
 
    z need at least one array to stackr z)all input arrays must have the same shaper
N)rFrGr8r9)
rÚ
ValueErrorÚshaperrrÚslicer*r+r@)
r5rFrGr8r9ÚarrÚshapesÚ result_ndimÚslÚexpanded_arrayss
          rrr|sՀðT*0Ö 0 #Œj˜oÐ 0€FÐ 0Ù ÜÐ;Ó<Ð<à#)Ö *˜Cˆci‹iÐ *€FÐ *Ü
ˆ6ƒ{aÒÜÐDÓEÐEà˜‘)—.‘. 1Ñ$€KÜ   kÓ 2€Dä
‹+ˆ˜$Ñ    ¤#§+¡+ Ñ    /€BØ*0Ö1 3s˜2“wÐ1€OÐ1Ü ?‰?˜?°¸3Ø!&°ô 9ð9ùò1ùò+ùò2s…CªC C ©rFcó—|fSrr©ÚxrFs  rÚ_unstack_dispatcherrVÖs    €Ø ˆ4€Krcóv—|jdk(r td«‚ttj||d««S)a5
    Split an array into a sequence of arrays along the given axis.
 
    The ``axis`` parameter specifies the dimension along which the array will
    be split. For example, if ``axis=0`` (the default) it will be the first
    dimension and if ``axis=-1`` it will be the last dimension.
 
    The result is a tuple of arrays split along ``axis``.
 
    .. versionadded:: 2.1.0
 
    Parameters
    ----------
    x : ndarray
        The array to be unstacked.
    axis : int, optional
        Axis along which the array will be split. Default: ``0``.
 
    Returns
    -------
    unstacked : tuple of ndarrays
        The unstacked arrays.
 
    See Also
    --------
    stack : Join a sequence of arrays along a new axis.
    concatenate : Join a sequence of arrays along an existing axis.
    block : Assemble an nd-array from nested lists of blocks.
    split : Split array into a list of multiple sub-arrays of equal size.
 
    Notes
    -----
    ``unstack`` serves as the reverse operation of :py:func:`stack`, i.e.,
    ``stack(unstack(x, axis=axis), axis=axis) == x``.
 
    This function is equivalent to ``tuple(np.moveaxis(x, axis, 0))``, since
    iterating on an array iterates along the first axis.
 
    Examples
    --------
    >>> arr = np.arange(24).reshape((2, 3, 4))
    >>> np.unstack(arr)
    (array([[ 0,  1,  2,  3],
            [ 4,  5,  6,  7],
            [ 8,  9, 10, 11]]),
     array([[12, 13, 14, 15],
            [16, 17, 18, 19],
            [20, 21, 22, 23]]))
    >>> np.unstack(arr, axis=1)
    (array([[ 0,  1,  2,  3],
            [12, 13, 14, 15]]),
     array([[ 4,  5,  6,  7],
            [16, 17, 18, 19]]),
     array([[ 8,  9, 10, 11],
            [20, 21, 22, 23]]))
    >>> arr2 = np.stack(np.unstack(arr, axis=1), axis=1)
    >>> arr2.shape
    (2, 3, 4)
    >>> np.all(arr == arr2)
    np.True_
 
    r
z!Input array must be at least 1-d.)rrJr"r*ÚmoveaxisrTs  rrrÙs4€ð@    ‡vv‚{ÜÐ<Ó=Ð=Ü ”—‘˜a  qÓ)Ó *Ð*rÚ __wrapped__có<—djd„|D««}d|zS)zM
    Convert a list of indices ``[0, 1, 2]`` into ``"arrays[0][1][2]"``.
    Úc3ó.K—|] }|€Œd|›d–—Œy­w)Nú[ú]r)Ú.0Úis  rú    <genexpr>z&_block_format_index.<locals>.<genexpr>+sèø€Ò? 1°±˜˜!˜˜A”hÑ?ùs‚Š r5)Újoin)ÚindexÚidx_strs  rÚ_block_format_indexre's#€ðg‰gÑ?¨Ô?Ó?€GØ gÑ Ðrc ó*‡—t|t«rtt‰«›d«‚t|t«rœt |«dkDrŽˆfd„t |«D«}t|«\}}}|D]a\}}}||z }||kDr|}t |«t |«k7r0tdt |«›dt |«›dt|«›d«‚|dŒ`|}Œc|||fSt|t«rt |«dk(r    ‰d    gzddfSt|«}‰t|«|fS)
aœ
    Recursive function checking that the depths of nested lists in `arrays`
    all match. Mismatch raises a ValueError as described in the block
    docstring below.
 
    The entire index (rather than just the depth) needs to be calculated
    for each innermost list, in case an error needs to be raised, so that
    the index of the offending list can be printed as part of the error.
 
    Parameters
    ----------
    arrays : nested list of arrays
        The arrays to check
    parent_index : list of int
        The full index of `arrays` within the nested lists passed to
        `_block_check_depths_match` at the top of the recursion.
 
    Returns
    -------
    first_index : list of int
        The full index of an element from the bottom of the nesting in
        `arrays`. If any element at the bottom is an empty list, this will
        refer to it, and the last index along the empty axis will be None.
    max_arr_ndim : int
        The maximum of the ndims of the arrays nested in `arrays`.
    final_size: int
        The number of elements in the final array. This is used the motivate
        the choice of algorithm used using benchmarking wisdom.
 
    z} is a tuple. Only lists can be used to arrange blocks, and np.block does not allow implicit conversion from tuple to ndarray.r
c3óD•K—|]\}}t|‰|gz«–—Œy­wr)Ú_block_check_depths_match)r_r`rMÚ parent_indexs   €rraz,_block_check_depths_match.<locals>.<genexpr>Zs+øèø€ò7Ù ˜!˜Sô0°°\ÀQÀCÑ5G×Hñ7ùsƒ z7List depths are mismatched. First element was at depth z#, but there is an element at depth z (ú)éÿÿÿÿN) r?r"r4rerErÚ    enumerateÚnextrJÚ_sizeÚ_ndim)    r5riÚ
idxs_ndimsÚ first_indexÚ max_arr_ndimÚ
final_sizercrÚsizes     `       rrhrh/sUø€ô>&œ%Ô ô Ü" <Ó0Ð1ð2Cð Có
ð    
ô
 
FœDÔ    !¤c¨&£k°A¢oó7Ü$-¨fÓ$5ô7ˆ
ô15°ZÓ0@Ñ-ˆ \ :Ø!+ò     $Ñ ˆE4˜Ø ˜$Ñ ˆJؐlÒ"Ø# ܐ5‹zœS Ó-Ò-Ü ðÜ  Ó-Ð.ð/Ü  ›Z˜L¨Ô+>¸uÓ+EÐ*FÀaðIóðð R‰yÑ Ø#‘ ð     $ð˜L¨*Ð4Ð4Ü    FœDÔ    !¤c¨&£k°QÒ&6à˜t˜fÑ$ a¨Ð*Ð*ôV‹}ˆØœU 6›]¨DÐ0Ð0rcó —t||dd¬«S)NT)ÚndminÚcopyÚsubok)r)Úars  rÚ _atleast_ndrzvs€ô ˜$ T°Ô 6Ð6rcó>—ttj|««Sr)rEÚ    itertoolsÚ
accumulate)Úvaluess rÚ _accumulater|s€Ü ”    ×$Ñ$ VÓ,Ó -Ð-rcóX‡‡    ‡
—|Dcgc]}|‰‘Œ    }}|d}|d‰Š
|‰dzdŠ    tˆˆ    ˆ
fd„|D««rtd‰›d«‚‰
t|«fz|‰dzdz}t|«}t    dg|z|«Dcgc]\}}t ||«f‘Œ}}}||fScc}wcc}}w)aëGiven array shapes, return the resulting shape and slices prefixes.
 
    These help in nested concatenation.
 
    Returns
    -------
    shape: tuple of int
        This tuple satisfies::
 
            shape, _ = _concatenate_shapes([arr.shape for shape in arrs], axis)
            shape == concatenate(arrs, axis).shape
 
    slice_prefixes: tuple of (slice(start, end), )
        For a list of arrays being concatenated, this returns the slice
        in the larger array at axis that needs to be sliced into.
 
        For example, the following holds::
 
            ret = concatenate([a, b, c], axis)
            _, (sl_a, sl_b, sl_c) = concatenate_slices([a, b, c], axis)
 
            ret[(slice(None),) * axis + sl_a] == a
            ret[(slice(None),) * axis + sl_b] == b
            ret[(slice(None),) * axis + sl_c] == c
 
        These are called slice prefixes since they are used in the recursive
        blocking algorithm to compute the left-most slices during the
        recursion. Therefore, they must be prepended to rest of the slice
        that was computed deeper in the recursion.
 
        These are returned as tuples to ensure that they can quickly be added
        to existing slice tuple without creating a new tuple every time.
 
    r
Nr c3óH•K—|]}|d‰‰k7xs |‰dzd‰k7–—Œy­w)Nr r)r_rKrFÚfirst_shape_postÚfirst_shape_pres  €€€rraz&_concatenate_shapes.<locals>.<genexpr>«sDøèø€ò EØ49𠐐$ˆ<˜?Ñ *ò 0Ø ˜‘Ð Ð/Ñ /ó 0ñ Eùsƒ"z,Mismatched array shapes in block along axis ú.)ÚanyrJÚsumrÚziprL) rNrFrKÚ shape_at_axisÚ first_shapeÚoffsets_at_axisÚstartÚendÚslice_prefixesr‚rƒs  `       @@rÚ_concatenate_shapesrŽ€sùú€ðH/5Ö5 UU˜4“[Ð5€MÐ5ð˜‘)€KØ! % 4Ð(€OØ" 4¨!¡8 9Ð-Ðä
õ EØ=Cô EôEäØ:¸4¸&ÀÐ BóDð    Dð¤ MÓ 2Ð4Ñ 4°{À4È!Á8À9Ð7MÑ M€Eä! -Ó0€Oä(+¨Q¨C°/Ñ,AØ,;ó)=÷>Ù$˜% ô˜U CÓ(Ò*ð>€Nñ>ð .Ð  Ð ùò%6ùó>s ˆ B!ÂB&c ó„—||kr“t|Dcgc]}t||||dz«‘Œc}Ž\}}}||z
|z}t||«\}}    t|    |«D
  cgc]\}
} | D]} |
| z‘Œ    Œ}} }
} tjt
j |«}|||fSt||«}|jdg|gfScc}wcc} } }
w)a
    Returns the shape of the final array, along with a list
    of slices and a list of arrays that can be used for assignment inside the
    new array
 
    Parameters
    ----------
    arrays : nested list of arrays
        The arrays to check
    max_depth : list of int
        The number of nested lists
    result_ndim : int
        The number of dimensions in thefinal array.
 
    Returns
    -------
    shape : tuple of int
        The shape that the final array will take on.
    slices: list of tuple of slices
        The slices into the full array required for assignment. These are
        required to be prepended with ``(Ellipsis, )`` to obtain to correct
        final index.
    arrays: list of ndarray
        The data to assign to each slice of the full array
 
    r r)    r‡Ú_block_info_recursionrŽÚ    functoolsÚreduceÚoperatorÚaddrzrK) r5Ú    max_depthrOÚdepthrMrNÚslicesrFrKrÚ slice_prefixÚ inner_slicesÚ    the_slices              rrr¹sý€ð6 ˆyÒÜ!$àö!Øô$ C¨°KÀÈÁÕKò!ð""ш˜ð˜YÑ&¨Ñ.ˆÜ 3°F¸DÓ Aшˆ~ô58¸ÈÓ4O÷1ð1Ù0l LØ#/ò1àð Ó*ð1Ð*ð1ˆò1ô
×!Ñ!¤(§,¡,°Ó7ˆàf˜fÐ$Ð$ô ˜& +Ó.ˆØy‰y˜2˜$  Ð%Ð%ùò+!ùô1s B6ÁB;c
óŒ—||kr/|Dcgc]}t||||dz«‘Œ}}t|||z
¬«St||«Scc}w)aZ
    Internal implementation of block based on repeated concatenation.
    `arrays` is the argument passed to
    block. `max_depth` is the depth of nested lists within `arrays` and
    `result_ndim` is the greatest of the dimensions of the arrays in
    `arrays` and the depth of the lists in `arrays` (see block docstring
    for details).
    r rR)Ú_blockÚ _concatenaterz)r5r•rOr–rMrBs      rrœrœîsa€ð ˆyÒà!ö#Øôs˜I {°E¸A±IÕ>ð#ˆð#ä˜D¨°UÑ):Ð';Ô<Ð<ô˜6 ;Ó/Ð/ùò #sŠAc#ónK—t|t«r|D]}t|«Ed{–—†Œy|–—y7Œ ­wr)r?rEÚ_block_dispatcher)r5Ú    subarrayss  rrŸrŸs;èø€ô&œ$ÔØò    4ˆIÜ(¨Ó3× 3Ñ 3ñ    4ð‹ ð 4ús ‚$5¦3§ 5cóf—t|«\}}}}||zdkDr t|||«St|||«S)a¶
    Assemble an nd-array from nested lists of blocks.
 
    Blocks in the innermost lists are concatenated (see `concatenate`) along
    the last dimension (-1), then these are concatenated along the
    second-last dimension (-2), and so on until the outermost list is reached.
 
    Blocks can be of any dimension, but will not be broadcasted using
    the normal rules. Instead, leading axes of size 1 are inserted,
    to make ``block.ndim`` the same for all blocks. This is primarily useful
    for working with scalars, and means that code like ``np.block([v, 1])``
    is valid, where ``v.ndim == 1``.
 
    When the nested list is two levels deep, this allows block matrices to be
    constructed from their components.
 
    Parameters
    ----------
    arrays : nested list of array_like or scalars (but not tuples)
        If passed a single ndarray or scalar (a nested list of depth 0), this
        is returned unmodified (and not copied).
 
        Elements shapes must match along the appropriate axes (without
        broadcasting), but leading 1s will be prepended to the shape as
        necessary to make the dimensions match.
 
    Returns
    -------
    block_array : ndarray
        The array assembled from the given blocks.
 
        The dimensionality of the output is equal to the greatest of:
 
        * the dimensionality of all the inputs
        * the depth to which the input list is nested
 
    Raises
    ------
    ValueError
        * If list depths are mismatched - for instance, ``[[a, b], c]`` is
          illegal, and should be spelt ``[[a, b], [c]]``
        * If lists are empty - for instance, ``[[a, b], []]``
 
    See Also
    --------
    concatenate : Join a sequence of arrays along an existing axis.
    stack : Join a sequence of arrays along a new axis.
    vstack : Stack arrays in sequence vertically (row wise).
    hstack : Stack arrays in sequence horizontally (column wise).
    dstack : Stack arrays in sequence depth wise (along third axis).
    column_stack : Stack 1-D arrays as columns into a 2-D array.
    vsplit : Split an array into multiple sub-arrays vertically (row-wise).
    unstack : Split an array into a tuple of sub-arrays along an axis.
 
    Notes
    -----
    When called with only scalars, ``np.block`` is equivalent to an ndarray
    call. So ``np.block([[1, 2], [3, 4]])`` is equivalent to
    ``np.array([[1, 2], [3, 4]])``.
 
    This function does not enforce that the blocks lie on a fixed grid.
    ``np.block([[a, b], [c, d]])`` is not restricted to arrays of the form::
 
        AAAbb
        AAAbb
        cccDD
 
    But is also allowed to produce, for some ``a, b, c, d``::
 
        AAAbb
        AAAbb
        cDDDD
 
    Since concatenation happens along the last axis first, `block` is *not*
    capable of producing the following directly::
 
        AAAbb
        cccbb
        cccDD
 
    Matlab's "square bracket stacking", ``[A, B, ...; p, q, ...]``, is
    equivalent to ``np.block([[A, B, ...], [p, q, ...]])``.
 
    Examples
    --------
    The most common use of this function is to build a block matrix:
 
    >>> import numpy as np
    >>> A = np.eye(2) * 2
    >>> B = np.eye(3) * 3
    >>> np.block([
    ...     [A,               np.zeros((2, 3))],
    ...     [np.ones((3, 2)), B               ]
    ... ])
    array([[2., 0., 0., 0., 0.],
           [0., 2., 0., 0., 0.],
           [1., 1., 3., 0., 0.],
           [1., 1., 0., 3., 0.],
           [1., 1., 0., 0., 3.]])
 
    With a list of depth 1, `block` can be used as `hstack`:
 
    >>> np.block([1, 2, 3])              # hstack([1, 2, 3])
    array([1, 2, 3])
 
    >>> a = np.array([1, 2, 3])
    >>> b = np.array([4, 5, 6])
    >>> np.block([a, b, 10])             # hstack([a, b, 10])
    array([ 1,  2,  3,  4,  5,  6, 10])
 
    >>> A = np.ones((2, 2), int)
    >>> B = 2 * A
    >>> np.block([A, B])                 # hstack([A, B])
    array([[1, 1, 2, 2],
           [1, 1, 2, 2]])
 
    With a list of depth 2, `block` can be used in place of `vstack`:
 
    >>> a = np.array([1, 2, 3])
    >>> b = np.array([4, 5, 6])
    >>> np.block([[a], [b]])             # vstack([a, b])
    array([[1, 2, 3],
           [4, 5, 6]])
 
    >>> A = np.ones((2, 2), int)
    >>> B = 2 * A
    >>> np.block([[A], [B]])             # vstack([A, B])
    array([[1, 1],
           [1, 1],
           [2, 2],
           [2, 2]])
 
    It can also be used in place of `atleast_1d` and `atleast_2d`:
 
    >>> a = np.array(0)
    >>> b = np.array([1])
    >>> np.block([a])                    # atleast_1d(a)
    array([0])
    >>> np.block([b])                    # atleast_1d(b)
    array([1])
 
    >>> np.block([[a]])                  # atleast_2d(a)
    array([[0]])
    >>> np.block([[b]])                  # atleast_2d(b)
    array([[1]])
 
 
    i)Ú _block_setupÚ_block_slicingÚ_block_concatenate)r5Ú    list_ndimrOrss    rrr sE€ôl2>¸fÓ1EÑ.€FˆI{ Jð :Ñ Ò/ܘf i°Ó=Ð=ä! &¨)°[ÓAÐArcó˜—t|«\}}}t|«}|r|d€tdt|«›d«‚t    ||«}||||fS)zD
    Returns
    (`arrays`, list_ndim, result_ndim, final_size)
    rkzList at z cannot be empty)rhrrJreÚmax)r5Ú bottom_indexÚarr_ndimrsr¥rOs      rr¢r¢¼sk€ô
*CÀ6Ó)JÑ&€L(˜JܐLÓ!€IÙ˜  RÑ(Ð0ÜØÔ*¨<Ó8Ð9Ð9IÐ Jó
ð    
ôh     Ó*€KØ 9˜k¨:Ð 5Ð5rcóP—t|||«\}}}tj|Dcgc]}|j‘Œc}Ž}t    d„|D««}t    d„|D««}|r|sdnd}    tj
|||    ¬«}
t ||«D]\} }||
tf| z<Œ|
Scc}w)Nc3ó:K—|]}|jd–—Œy­w)Ú F_CONTIGUOUSN©Úflags©r_rMs  rraz!_block_slicing.<locals>.<genexpr>Ñóèø€Ò>°#—)‘)˜NÕ+Ñ>ùó‚c3ó:K—|]}|jd–—Œy­w)Ú C_CONTIGUOUSNr­r¯s  rraz!_block_slicing.<locals>.<genexpr>Òr°r±ÚFÚC)rKr8Úorder)rr*Ú result_typer8ÚallÚemptyr‡ÚEllipsis) r5r¥rOrKr—rMr8ÚF_orderÚC_orderr¶r#ršs             rr£r£Ës­€Ü1ؐ    ˜;ó(Ñ€Eˆ66ä O‰O°6Ö:¨C˜cŸi›iÒ:Ð ;€EôÑ>°vÔ>Ó>€GÜÑ>°vÔ>Ó>€GÙ¡7‰C°€EÜ Y‰Y˜U¨%°uÔ =€Fô
˜f fÓ-ò.‰ˆ    3Ø*-ˆ”ˆ{˜YÑ&Ò'ð.à €Mùò;s¥B#cóJ—t|||«}|dk(r|j«}|S)Nr
)rœrw)r5r¥rOr#s    rr¤r¤Þs)€Ü F˜I {Ó 3€FؐA‚~ð
—‘“ˆØ €Mr)NN)r
N)r
)1Ú__all__r‘r|r“r[r Ú_from_nxr r*rÚ
multiarrayrrrÚpartialÚarray_function_dispatchrrr'rr.rr6r<r    rrHrrVrÚgetattrrtrnrror@rrerhrzrrŽrrœrŸrr¢r£r¤rrrú<module>rÄs    ðò )€óÛÛå%ÝÝß?Ñ?à+˜)×+Ñ+Ø ×%Ñ%¨gô7ÐòñÐ/Ó0ñ3ó1ð3òlñÐ/Ó0ñ3ó1ð3òlñÐ/Ó0ñAó1ðAòHð'+°Dô-ñÐ,Ó-Ø {óGBó.ðGBñTÐ,Ó-Ø {óGFó.ðGFðTØ ¨$ôñÐ*Ó+ðW9¨T¸;óW9ó,ðW9ðr'+ôñÐ,Ó-ØóA+ó.ðA+ñN    — ‘ ˜}¨h¯m©mÓ<€Ù— ‘ ˜}¨h¯m©mÓ<€Ùx×+Ñ+Ø$ h×&:Ñ&:ó<€ òð46óD1òN7ò .ò6!ór2&ój0ò&ñÐ*Ó+ñhBó,ðhBò^ 6òó&r