def _append_const(arr, pad_amt, val, axis=-<NUM_LIT:1>):
if pad_amt == <NUM_LIT:0>:<EOL><INDENT>return arr<EOL><DEDENT>padshape = tuple(x if i != axis else pad_amt<EOL>for (i, x) in enumerate(arr.shape))<EOL>if val == <NUM_LIT:0>:<EOL><INDENT>return np.concatenate((arr, np.zeros(padshape, dtype=arr.dtype)),<EOL>axis=axis)<EOL><DEDENT>else:<EOL><INDENT>return np.concatenate(<EOL>(arr, (np.zeros(padshape) + val).astype(arr.dtype)), axis=axis)<EOL><DEDENT>
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`.