ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ ]c@`s:dZddlmZmZmZddlZdgZedZ dZ ddZ dd Z dd Z dd Zdd Zdd ZddZddZddZddZddZddZddZddZddZddZddZedZdZdZdS(sl The arraypad module contains a group of functions to pad values onto the edges of an n-dimensional array. i(tdivisiontabsolute_importtprint_functionNtpadc`stfdt|jD}|sKtjdd}ntjdd}|j|}xEtD]7\}}|j||kr|j|d|}qqW|S(s Create an ndarray of `shape` with increments along specified `axis` Parameters ---------- arr : ndarray Input array of arbitrary shape. shape : tuple of ints Shape of desired array. Should be equivalent to `arr.shape` except `shape[axis]` which may have any positive value. axis : int Axis to increment along. reverse : bool If False, increment in a positive fashion from 1 to `shape[axis]`, inclusive. If True, the bounds are the same but the order reversed. Returns ------- padarr : ndarray Output array sized to pad `arr` along `axis`, with linear range from 1 to `shape[axis]` along specified `axis`. Notes ----- The range is deliberately 1-indexed for this specific use case. Think of this algorithm as broadcasting `np.arange` to a single `axis` of an arbitrarily shaped ndarray. c3`s1|]'\}}|kr!dnVqdS(iN((t.0titx(taxistshape(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys 0siiiR(ttuplet enumerateRtnptarangetreshapetrepeat(tarrRRtreverset initshapetpadarrRtdim((RRsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt_arange_ndarrayscC`s,tj|tjr(|jd|ndS(s Rounds arr inplace if destination dtype is integer. Parameters ---------- arr : ndarray Input array. dtype : dtype The dtype of the destination array. toutN(R t issubdtypetintegertround(Rtdtype((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt_round_ifneeded=s ic`sdkr|Stfdt|jD}|dkrotjtj|d|j|fdStjtj||j|j|fdSdS(s Prepend constant `val` along `axis` of `arr`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to prepend. val : scalar Constant value to use. For best results should be of type `arr.dtype`; if not `arr.dtype` will be cast to `arr.dtype`. axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` constant `val` prepended along `axis`. ic3`s-|]#\}}|kr!|nVqdS(N((RRR(Rtpad_amt(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys esRRN(R R RR t concatenatetzerosRtastype(RRtvalRtpadshape((RRsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt_prepend_constMs  $"c`sdkr|Stfdt|jD}|dkrotj|tj|d|jfdStj|tj||j|jfdSdS(s Append constant `val` along `axis` of `arr`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to append. val : scalar Constant value to use. For best results should be of type `arr.dtype`; if not `arr.dtype` will be cast to `arr.dtype`. axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` constant `val` appended along `axis`. ic3`s-|]#\}}|kr!|nVqdS(N((RRR(RR(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sRRN(R R RR RRRR(RRRRR ((RRsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _append_constos  $c`s|dkr|Stfdt|jD}tfdt|jD}||j|}tj|j|d|fdS(s Prepend `pad_amt` to `arr` along `axis` by extending edge values. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to prepend. axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, extended by `pad_amt` edge values appended along `axis`. ic3`s3|])\}}|kr'tdndVqdS(iN(tslicetNone(RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sR(R R RR R RR(RRRt edge_slicet pad_singletontedge_arr((RsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _prepend_edges !c`s|dkrStfdtjD}tfdtjD}|j|}tj|j|dfdS(s Append `pad_amt` to `arr` along `axis` by extending edge values. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to append. axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, extended by `pad_amt` edge values prepended along `axis`. ic3`s>|]4\}}|kr'tdnjdVqdS(iN(R#R$R(RRR(RR(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sR(R R RR R RR(RRRR%R&R'((RRsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _append_edges !c `s"dkr|Stfdt|jD}t||dtjtj}tfdt|jD}tfdt|jD}||j|j }||t } || }||7}t ||j tj |j|j |fdS(sF Prepend linear ramp along `axis`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to prepend. end : scalar Constal value to use. For best results should be of type `arr.dtype`; if not `arr.dtype` will be cast to `arr.dtype`. axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values prepended along `axis`. The prepended region ramps linearly from the edge value to `end`. ic3`s-|]#\}}|kr!|nVqdS(N((RRR(RR(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sRc3`s3|])\}}|kr'tdndVqdS(iN(R#R$(RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sR(R R RRtTrueRR tfloat64R RtfloatRRR( RRtendRR tramp_arrR%R&tedge_padtslope((RRsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _prepend_ramps    c `s"dkr|Stfdt|jD}t||dtjtj}tfdt|jD}tfdt|jD}||j|j }||t } || }||7}t ||j tj ||j|j fdS(sB Append linear ramp along `axis`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to append. end : scalar Constal value to use. For best results should be of type `arr.dtype`; if not `arr.dtype` will be cast to `arr.dtype`. axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values appended along `axis`. The appended region ramps linearly from the edge value to `end`. ic3`s-|]#\}}|kr!|nVqdS(N((RRR(RR(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys &sRc3`s3|])\}}|kr'tdndVqdS(iN(R#R$(RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys .sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys 2sR(R R RRtFalseRR R+R RR,RRR( RRR-RR R.R%R&R/R0((RRsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _append_ramp s    c`s|dkr|Sdkr,t||Sdk rW|jkrWdqWntfdt|jD}tfdt|jD}||jdj|}tj|j |d|fdS(sS Prepend `pad_amt` maximum values along `axis`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to prepend. num : int Depth into `arr` along `axis` to calculate maximum. Range: [1, `arr.shape[axis]`] or None (entire axis) axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values appended along `axis`. The prepended region is the maximum of the first `num` values along `axis`. iic3`s9|]/\}}|kr'tdn tVqdS(N(R#R$(RRR(Rtnum(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys gsc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys ksRN( R(R$RR R tmaxR R RR(RRR4Rt max_sliceR&t max_chunk((RR4sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _prepend_maxBs    !c`s'|dkr|Sdkr,t||Sdk rW|jkrWdqWn|jddk rtfdt|jD}ntd|jD}tfdt|jD}||jdj|}tj||j |dfdS(s_ Pad one `axis` of `arr` with the maximum of the last `num` elements. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to append. num : int Depth into `arr` along `axis` to calculate maximum. Range: [1, `arr.shape[axis]`] or None (entire axis) axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values appended along `axis`. The appended region is the maximum of the final `num` values along `axis`. iic3`sC|]9\}}|kr'tdntdVqdS(iN(R#R$(RRR(RR-R4(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys scs`s|]}tdVqdS(N(R#R$(RR((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sRN( R)R$RR R R5R R RR(RRR4RR6R&R7((RR-R4sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _append_maxvs$     !c`s|dkr|Sdkr,t||Sdk rW|jkrWdqWntfdt|jD}tfdt|jD}||jj|}t||jt j |j |j |j|fdS(sC Prepend `pad_amt` mean values along `axis`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to prepend. num : int Depth into `arr` along `axis` to calculate mean. Range: [1, `arr.shape[axis]`] or None (entire axis) axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values prepended along `axis`. The prepended region is the mean of the first `num` values along `axis`. iic3`s9|]/\}}|kr'tdn tVqdS(N(R#R$(RRR(RR4(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sRN( R(R$RR R tmeanR RRR RRR(RRR4Rt mean_sliceR&t mean_chunk((RR4sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _prepend_means    !c`s@|dkr|Sdkr,t||Sdk rW|jkrWdqWn|jddk rtfdt|jD}ntd|jD}tfdt|jD}||jdj|}t||jt j ||j |j |jfdS(sB Append `pad_amt` mean values along `axis`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to append. num : int Depth into `arr` along `axis` to calculate mean. Range: [1, `arr.shape[axis]`] or None (entire axis) axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values appended along `axis`. The appended region is the maximum of the final `num` values along `axis`. iic3`sC|]9\}}|kr'tdntdVqdS(iN(R#R$(RRR(RR-R4(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys scs`s|]}tdVqdS(N(R#R$(RR((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sRN( R)R$RR R R:R RRR RRR(RRR4RR;R&R<((RR-R4sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _append_means&     c`s|dkr|Sdkr,t||Sdk rW|jkrWdqWntfdt|jD}tfdt|jD}tj||dj|}t||j tj |j |j |j |fdS(sI Prepend `pad_amt` median values along `axis`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to prepend. num : int Depth into `arr` along `axis` to calculate median. Range: [1, `arr.shape[axis]`] or None (entire axis) axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values prepended along `axis`. The prepended region is the median of the first `num` values along `axis`. iic3`s9|]/\}}|kr'tdn tVqdS(N(R#R$(RRR(RR4(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys ?sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys CsRN( R(R$RR R R tmedianR RRRRR(RRR4Rt med_sliceR&t med_chunk((RR4sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _prepend_meds    "c`sC|dkr|Sdkr,t||Sdk rW|jkrWdqWn|jddk rtfdt|jD}ntd|jD}tfdt|jD}tj||dj|}t||j tj ||j |j |j fdS(sE Append `pad_amt` median values along `axis`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to append. num : int Depth into `arr` along `axis` to calculate median. Range: [1, `arr.shape[axis]`] or None (entire axis) axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values appended along `axis`. The appended region is the median of the final `num` values along `axis`. iic3`sC|]9\}}|kr'tdntdVqdS(iN(R#R$(RRR(RR-R4(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys vscs`s|]}tdVqdS(N(R#R$(RR((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys ysc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys |sRN( R)R$RR R R R?R RRRRR(RRR4RR@R&RA((RR-R4sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _append_medOs&     "c`s|dkr|Sdkr,t||Sdk rW|jkrWdqWntfdt|jD}tfdt|jD}||jdj|}tj|j |d|fdS(sT Prepend `pad_amt` minimum values along `axis`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to prepend. num : int Depth into `arr` along `axis` to calculate minimum. Range: [1, `arr.shape[axis]`] or None (entire axis) axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values prepended along `axis`. The prepended region is the minimum of the first `num` values along `axis`. iic3`s9|]/\}}|kr'tdn tVqdS(N(R#R$(RRR(RR4(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sRN( R(R$RR R tminR R RR(RRR4Rt min_sliceR&t min_chunk((RR4sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _prepend_mins    !c`s'|dkr|Sdkr,t||Sdk rW|jkrWdqWn|jddk rtfdt|jD}ntd|jD}tfdt|jD}||jdj|}tj||j |dfdS(sG Append `pad_amt` median values along `axis`. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : int Amount of padding to append. num : int Depth into `arr` along `axis` to calculate minimum. Range: [1, `arr.shape[axis]`] or None (entire axis) axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt` values appended along `axis`. The appended region is the minimum of the final `num` values along `axis`. iic3`sC|]9\}}|kr'tdntdVqdS(iN(R#R$(RRR(RR-R4(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys scs`s|]}tdVqdS(N(R#R$(RR((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sRN( R)R$RR R RDR R RR(RRR4RRER&RF((RR-R4sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _append_mins$     !c `s#ddkr$ddkr$|Stfdt|jD}||}tfdt|jD}ddkr|j|}nd|krddkrtfdt|jD}||j|}d||}~n|jdd|jdtfdt|jD}tfd t|jD} ||| } ddkr| j|} nd|krtfd t|jD} || j|}d|| } ~ntj||| fd S( s Pad `axis` of `arr` by reflection. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : tuple of ints, length 2 Padding to (prepend, append) along `axis`. method : str Controls method of reflection; options are 'even' or 'odd'. axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt[0]` values prepended and `pad_amt[1]` values appended along `axis`. Both regions are padded with reflected values from the original array. Notes ----- This algorithm does not pad with repetition, i.e. the edges are not repeated in the reflection. For that behavior, use `mode='symmetric'`. The modes 'reflect', 'symmetric', and 'wrap' must be padded with a single function, lest the indexing tricks in non-integer multiples of the original shape would violate repetition in the final iteration. iic3`sC|]9\}}|kr'tdntdddVqdS(iiN(R#R$(RRR(RR(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys "stoddc3`s3|])\}}|kr'tdndVqdS(iN(R#R$(RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys )sic3`s<|]2\}}|kr'tdn tVqdS(N(R#R$(RRR(RR-tstart(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys 5sc3`s?|]5\}}|kr'tdntdddVqdS(iN(R#R$(RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys 7sc3`s3|])\}}|kr'tdndVqdS(iN(R#R$(RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys ?sR(R R RR R R( RRtmethodRt ref_slicet ref_chunk1R&t edge_slice1t edge_chunktrev_idxt ref_chunk2t edge_slice2((RR-RRJsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt_pad_refs>!   c `sddkr$ddkr$|Stfdt|jD}tfdt|jD}|||}tfdt|jD}ddkr|j|}nd|kr.ddkr.tfdt|jD}||j|} d| |}~ n|jd|jtfd t|jD}|||} ddkr| j|} nd|krtfd t|jD} || j|} d| | } ~ ntj||| fd S( s Pad `axis` of `arr` by symmetry. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : tuple of ints, length 2 Padding to (prepend, append) along `axis`. method : str Controls method of symmetry; options are 'even' or 'odd'. axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt[0]` values prepended and `pad_amt[1]` values appended along `axis`. Both regions are padded with symmetric values from the original array. Notes ----- This algorithm DOES pad with repetition, i.e. the edges are repeated. For padding without repeated edges, use `mode='reflect'`. The modes 'reflect', 'symmetric', and 'wrap' must be padded with a single function, lest the indexing tricks in non-integer multiples of the original shape would violate repetition in the final iteration. iic3`s@|]6\}}|kr'tdntddVqdS(iN(R#R$(RRR(RR(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys qsc3`s?|]5\}}|kr'tdntdddVqdS(iN(R#R$(RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys ssc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys xsRIc3`s3|])\}}|kr'tdndVqdS(iN(R#R$(RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sic3`s<|]2\}}|kr'tdn tVqdS(N(R#R$(RRR(RR-RJ(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s3|])\}}|kr'tdndVqdS(iN(R#R$(RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sR(R R RR R R( RRRKRt sym_sliceRPt sym_chunk1R&RNROt sym_chunk2RR((RR-RRJsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt_pad_symIs>!   c`s2ddkr$ddkr$|S|jd|jtfdt|jD}||}tfdt|jD}ddkr|j|}ntfdt|jD}||}ddkr|j|}ntj|||fdS(s1 Pad `axis` of `arr` via wrapping. Parameters ---------- arr : ndarray Input array of arbitrary shape. pad_amt : tuple of ints, length 2 Padding to (prepend, append) along `axis`. axis : int Axis along which to pad `arr`. Returns ------- padarr : ndarray Output array, with `pad_amt[0]` values prepended and `pad_amt[1]` values appended along `axis`. Both regions are padded wrapped values from the opposite end of `axis`. Notes ----- This method of padding is also known as 'tile' or 'tiling'. The modes 'reflect', 'symmetric', and 'wrap' must be padded with a single function, lest the indexing tricks in non-integer multiples of the original shape would violate repetition in the final iteration. iic3`s<|]2\}}|kr'tdn tVqdS(N(R#R$(RRR(RR-RJ(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s-|]#\}}|kr!|ndVqdS(iN((RRR(R(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sc3`s@|]6\}}|kr'tdntddVqdS(iiN(R#R$(RRR(RR(sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sR(RR R R R R(RRRt wrap_slicet wrap_chunk1R&t wrap_chunk2((RR-RRJsE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt _pad_wraps"    cC`s|j}|dkrd|Stj|}ytj||df}Wn*tk rtd}t||fnX|tkrtj|jt }nt d|j DS(sZ Private function which does some checks and normalizes the possibly much simpler representations of 'pad_width', 'stat_length', 'constant_values', 'end_values'. Parameters ---------- narray : ndarray Input ndarray shape : {sequence, array_like, float, int}, optional The width of padding (pad_width), the number of elements on the edge of the narray used for statistics (stat_length), the constant value(s) to use when filling padded regions (constant_values), or the endpoint target(s) for linear ramps (end_values). ((before_1, after_1), ... (before_N, after_N)) unique number of elements for each axis where `N` is rank of `narray`. ((before, after),) yields same before and after constants for each axis. (constant,) or val is a shortcut for before = after = constant for all axes. cast_to_int : bool, optional Controls if values in ``shape`` will be rounded and cast to int before being returned. Returns ------- normalized_shape : tuple of tuples val => ((val, val), (val, val), ...) [[val1, val2], [val3, val4], ...] => ((val1, val2), (val3, val4), ...) ((val1, val2), (val3, val4), ...) => no change [[val1, val2], ] => ((val1, val2), (val1, val2), ...) ((val1, val2), ) => ((val1, val2), (val1, val2), ...) [[val , ], ] => ((val, val), (val, val), ...) ((val , ), ) => ((val, val), (val, val), ...) is/Unable to create correctly shaped tuple from %scs`s|]}t|VqdS(N(R (RR((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pys sN(NN((NN( tndimR$R tasarrayt broadcast_tot ValueErrorR*RRtintR ttolist(tndarrayRt cast_to_inttndimst shape_arrtfmt((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt_normalize_shapes%    cC`st||}x|D]}g|D]}|dkr;dn|^q#}g|D]}|dkrfdnd^qN}|ddks|ddkrd}t||fqqW|S(s Private function which does some checks and reformats pad_width and stat_length using _normalize_shape. Parameters ---------- narray : ndarray Input ndarray number_elements : {sequence, int}, optional The width of padding (pad_width) or the number of elements on the edge of the narray used for statistics (stat_length). ((before_1, after_1), ... (before_N, after_N)) unique number of elements for each axis. ((before, after),) yields same before and after constants for each axis. (constant,) or int is a shortcut for before = after = constant for all axes. Returns ------- _validate_lengths : tuple of tuples int => ((int, int), (int, int), ...) [[int1, int2], [int3, int4], ...] => ((int1, int2), (int3, int4), ...) ((int1, int2), (int3, int4), ...) => no change [[int1, int2], ] => ((int1, int2), (int1, int2), ...) ((int1, int2), ) => ((int1, int2), (int1, int2), ...) [[int , ], ] => ((int, int), (int, int), ...) ((int , ), ) => ((int, int), (int, int), ...) iiis"%s cannot contain negative values.N(RgR$R_(tnarraytnumber_elementstnormshpRRtchkRf((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyt_validate_lengthss ++ cK`s tj|jjdks*tdntj|}t||}i dgd6gd6dgd6dgd 6dgd 6dgd 6dgd 6d gd6d gd6gd6}idd6dd6dd6dd 6}t|tj j rx;|D]3}|||krt d|||fqqWx&||D]}|j |||q,WxK|D]X} | dkr}t||| || Padding function, see Notes. stat_length : sequence or int, optional Used in 'maximum', 'mean', 'median', and 'minimum'. Number of values at edge of each axis used to calculate the statistic value. ((before_1, after_1), ... (before_N, after_N)) unique statistic lengths for each axis. ((before, after),) yields same before and after statistic lengths for each axis. (stat_length,) or int is a shortcut for before = after = statistic length for all axes. Default is ``None``, to use the entire axis. constant_values : sequence or int, optional Used in 'constant'. The values to set the padded values for each axis. ((before_1, after_1), ... (before_N, after_N)) unique pad constants for each axis. ((before, after),) yields same before and after constants for each axis. (constant,) or int is a shortcut for before = after = constant for all axes. Default is 0. end_values : sequence or int, optional Used in 'linear_ramp'. The values used for the ending value of the linear_ramp and that will form the edge of the padded array. ((before_1, after_1), ... (before_N, after_N)) unique end values for each axis. ((before, after),) yields same before and after end values for each axis. (constant,) or int is a shortcut for before = after = end value for all axes. Default is 0. reflect_type : {'even', 'odd'}, optional Used in 'reflect', and 'symmetric'. The 'even' style is the default with an unaltered reflection around the edge value. For the 'odd' style, the extented part of the array is created by subtracting the reflected values from two times the edge value. Returns ------- pad : ndarray Padded array of rank equal to `array` with shape increased according to `pad_width`. Notes ----- .. versionadded:: 1.7.0 For an array with rank greater than 1, some of the padding of later axes is calculated from padding of previous axes. This is easiest to think about with a rank 2 array where the corners of the padded array are calculated by using padded values from the first axis. The padding function, if used, should return a rank 1 array equal in length to the vector argument with padded values replaced. It has the following signature:: padding_func(vector, iaxis_pad_width, iaxis, **kwargs) where vector : ndarray A rank 1 array already padded with zeros. Padded values are vector[:pad_tuple[0]] and vector[-pad_tuple[1]:]. iaxis_pad_width : tuple A 2-tuple of ints, iaxis_pad_width[0] represents the number of values padded at the beginning of vector where iaxis_pad_width[1] represents the number of values padded at the end of vector. iaxis : int The axis currently being calculated. kwargs : misc Any keyword arguments the function requires. Examples -------- >>> a = [1, 2, 3, 4, 5] >>> np.lib.pad(a, (2,3), 'constant', constant_values=(4, 6)) array([4, 4, 1, 2, 3, 4, 5, 6, 6, 6]) >>> np.lib.pad(a, (2, 3), 'edge') array([1, 1, 1, 2, 3, 4, 5, 5, 5, 5]) >>> np.lib.pad(a, (2, 3), 'linear_ramp', end_values=(5, -4)) array([ 5, 3, 1, 2, 3, 4, 5, 2, -1, -4]) >>> np.lib.pad(a, (2,), 'maximum') array([5, 5, 1, 2, 3, 4, 5, 5, 5]) >>> np.lib.pad(a, (2,), 'mean') array([3, 3, 1, 2, 3, 4, 5, 3, 3]) >>> np.lib.pad(a, (2,), 'median') array([3, 3, 1, 2, 3, 4, 5, 3, 3]) >>> a = [[1, 2], [3, 4]] >>> np.lib.pad(a, ((3, 2), (2, 3)), 'minimum') array([[1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 2, 1, 1, 1], [3, 3, 3, 4, 3, 3, 3], [1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 2, 1, 1, 1]]) >>> a = [1, 2, 3, 4, 5] >>> np.lib.pad(a, (2, 3), 'reflect') array([3, 2, 1, 2, 3, 4, 5, 4, 3, 2]) >>> np.lib.pad(a, (2, 3), 'reflect', reflect_type='odd') array([-1, 0, 1, 2, 3, 4, 5, 6, 7, 8]) >>> np.lib.pad(a, (2, 3), 'symmetric') array([2, 1, 1, 2, 3, 4, 5, 5, 4, 3]) >>> np.lib.pad(a, (2, 3), 'symmetric', reflect_type='odd') array([0, 1, 1, 2, 3, 4, 5, 5, 6, 7]) >>> np.lib.pad(a, (2, 3), 'wrap') array([4, 5, 1, 2, 3, 4, 5, 1, 2, 3]) >>> def padwithtens(vector, pad_width, iaxis, kwargs): ... vector[:pad_width[0]] = 10 ... vector[-pad_width[1]:] = 10 ... return vector >>> a = np.arange(6) >>> a = a.reshape((2, 3)) >>> np.lib.pad(a, 2, padwithtens) array([[10, 10, 10, 10, 10, 10, 10], [10, 10, 10, 10, 10, 10, 10], [10, 10, 0, 1, 2, 10, 10], [10, 10, 3, 4, 5, 10, 10], [10, 10, 10, 10, 10, 10, 10], [10, 10, 10, 10, 10, 10, 10]]) Rs%`pad_width` must be of integral type.tconstant_valuestconstanttedget end_valuest linear_rampt stat_lengthtmaximumR:R?tminimumt reflect_typetreflectt symmetrictwrapitevens%%s keyword not in allowed keywords %sRcs:There aren't any elements to reflect in axis {} of `array`iN(RpRm(-R R]Rtkindt TypeErrortarrayRlR$t isinstancetcompatt basestringR_t setdefaultRgR2tlisttrangeR\tsumR#RRtapply_along_axistcopyR tzipR!R"R(R)R1R3R8R9R=R>RBRCRGRHtformatRDRSRWR[(R|t pad_widthtmodetkwargsRht allowedkwargst kwdefaultstkeytkwRtfunctiontrankttotal_dim_increaset offset_slicest new_shapetnewmattiaxisRt pad_beforet pad_aftert before_valt after_valt chunk_beforet chunk_afterRKtsafe_padt pad_iter_bt pad_iter_a((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyRFs              &:      5  5 5 5 5 5       "       "     ( t__doc__t __future__RRRtnumpyR t__all__R2RRR!R"R(R)R1R3R8R9R=R>RBRCRGRHRSRWR[R*RgRlR(((sE/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/arraypad.pyts2   +  " " ! " 7 7 4 8 4 9 4 9 4 8 U T @ < -